all groups > dotnet windows forms > january 2006 >
You're in the

dotnet windows forms

group:

DataGridView automatically selects first row


DataGridView automatically selects first row Brett
1/31/2006 3:22:21 PM
dotnet windows forms:
I'm setting the datasource of a DataGridView to a datatable. This
loads the grid correctly but it automatically selects the first row in
the grid, triggering the SelectionChanged event. Is there a way to
stop the grid from automatically selecting the first row?

Thanks.
RE: DataGridView automatically selects first row Brandon
2/7/2006 8:54:42 AM
Try handling the DataBindingComplete() event and setting selectedIndex = -1.
--
He who dies with the most toys wins.


[quoted text, click to view]
RE: DataGridView automatically selects first row Nkem
4/19/2006 9:56:02 AM
You would just as well do this: datagridviewname.ClearSelection(); right
after loading data.

[quoted text, click to view]
AddThis Social Bookmark Button