Hi i have a gridview displaying data at page load and i added a column delete.

i have the primary key of the table displayed in the gridview as foreignkey in another table. so i cannot use wizard to just type my SQL in delete command.

Can someone please help me on where and how to write the code behind the delete event of the gridview so that when i select a record, i can keep the primary key in a label and check it in the other table before deleting.

Perhaps you are asking for DataGridView1.CellClickevent ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.