How to get the Index of Currently Selected Row in DataGridView using C#

Total Post:102

Points:714

C# 
C#
 5130  View(s)
Ratings:
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).

  1. Re: How to get the Index of Currently Selected Row in DataGridView using C#

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



    datagridview.CurrentCell.RowIndex


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

      Modified On Mar-31-2018 04:44:23 AM

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.