It's that simple. 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).
C# – Index of Currently Selected Row in DataGridView
cdatagridviewnetwinforms
Related Topic
- C# – Deep cloning objects
- C# – Catch multiple exceptions at once
- C# – Case insensitive ‘Contains(string)’
- C# – LINQ’s Distinct() on a particular property
- C# – Get int value from enum in C#
- C# – How to remedy “The breakpoint will not currently be hit. No symbols have been loaded for this document.” warning
- C# – How to Sort a List
by a property in the object - Scala: list.flatten: no implicit argument matching parameter type (Any) = > Iterable[Any] was found
Best Answer
There is the
RowIndex
property for theCurrentCell
property for the DataGridView.Handle the
SelectionChanged
event and find the index of the selected row as above.