I m using a data gridveiw control in Window forms application and i want to delete the record on which the user clicks, for this purpose i need to get the index of the clicked row.
How can i get these.........
Kindly tell me if anybody has a solution.........
There is a "Delete" button that you can add to your GridView as a column...so that if the user wants to delete a row they can click this button.
This button will thrown a RowDeleting event.
When you handle this event in your code, you will be passed a variable of type GridViewDeleteEventArgs. This variable name is "e".
From this variable you can determine what row the user has picked to delete by retriving the value from the GridViewDeleteEventArg varaible's RowIndex property:
IE: e.RowIndex
Cheers
-Frinny