Memo
-
How to count the number of selected rows in a DataGridView?\
Let's say I highlighted 5 rows, how can I show it in message box?
Please help I'm using WinForms in C#!
→ Read more...
-
I have some trouble with setting the last row in my datagridview selected. I select the last row this way:
if (grid.Rows.Count > 0)
{
try
{
grid.Rows[grid.Rows.Count - 1].Selected = true;
grid.CurrentCell = grid.Rows[grid.Rows.Count - 1].Cells[1]
}
catch (IndexOutOfRangeException)
{ }
catch (ArgumentOutOfRangeException)
{ }
}
When I execute this code I get an exception:
When I debug the Rowscollection and the corresponding Cells collection I see both collections are filled. The index also exists of the Rows and Cells collection.
I have no clue what I am doing wrong here. Someone who can help me out here? Thnx
→ Read more...
7482 person(s) visited this page until now.