Home > DeveloperSection > Forums > How to get the Index of Currently Selected Row in DataGridView using C#
Mark Devid
Mark Devid

Total Post:101

Posted on    October-05-2013 2:25 AM

 C# C# 

 1 Reply(s)
 2382  View(s)
Rate this:

How do I get the index of the currently selected Row of a DataGridView?

I don't want the Row object, I want the index (0 .. n).

Dag Hammarskjold
Dag Hammarskjold

Total Post:24

Posted on    October-05-2013 4:12 AM

There is the RowIndex property for the CurrentCell property for the DataGridView.


Handle the SelectionChanged event and find the index of the selected row as above.

Don't want to miss updates? Please click the below button!

Follow MindStick