alfardan
asked on
DataGridView - Row Selection
Hi
I have a daragrid in a windows application, and when it loads it selects its first row by default, I don't want that, how do I let this datagrid selects no row when it loads?
I have a daragrid in a windows application, and when it loads it selects its first row by default, I don't want that, how do I let this datagrid selects no row when it loads?
ASKER
I'm not binding data to the grid, I'm adding rows through a for loop
Not sure if this will work, but try setting the currentcell to nothing at the end of the form load event, e.g
Me.DataGridView1.CurrentCell = Nothing
ASKER
Didn't work, still selects the first row by default
Then
Me.DataGridView1.ClearSelection()
and / or setting the tab index for the datagridview to greater than 0 should work
ASKER
Didn't work either
Ok, how do I make the row selection coloring to be of a specific color that I determine instead of the default BLUE one?
Ok, how do I make the row selection coloring to be of a specific color that I determine instead of the default BLUE one?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
dataGridView.ClearSelectio
(calling .ClearSelection() from the DataBindingComplete event of the DataGridView itself.)