Disable DataGridView auto selecting 1st row
-
hi all, I have a datagridview which when I populate it with data, the first row is selected by default. IIRC in .Net 1.1 the DataGrid never used to do this. Any one know how I can stop it? I've tried setting every row's Selected property to false. Thanks
-
hi all, I have a datagridview which when I populate it with data, the first row is selected by default. IIRC in .Net 1.1 the DataGrid never used to do this. Any one know how I can stop it? I've tried setting every row's Selected property to false. Thanks
-
First Check whether u have write any code in the Rowbound. If not please check whether selectedIndex prrperty is set to -1. I hope this will solve ur problem
Regards, A Jabeer Ali
there isn't a selectedIndex property and I haven't hooked any events as of yet.
-
there isn't a selectedIndex property and I haven't hooked any events as of yet.
-
Sorry My friend. This Option is available in net.2005 for ASP:gridview. what version u r using?
Regards, A Jabeer Ali
.Net 2.0 with C# 2005. I am using a WinForms DataGridView.
-
.Net 2.0 with C# 2005. I am using a WinForms DataGridView.
I have tried ClearSelection and I have also set the selection mode to select a full row
-
I have tried ClearSelection and I have also set the selection mode to select a full row
-
And do what may I ask? I am unable to change it and the grid.RowTemplate.Index is read-only.
-
And do what may I ask? I am unable to change it and the grid.RowTemplate.Index is read-only.
I've found that ClearSelection will only work if I use the DataSource property.
-
hi all, I have a datagridview which when I populate it with data, the first row is selected by default. IIRC in .Net 1.1 the DataGrid never used to do this. Any one know how I can stop it? I've tried setting every row's Selected property to false. Thanks
-
hi all, I have a datagridview which when I populate it with data, the first row is selected by default. IIRC in .Net 1.1 the DataGrid never used to do this. Any one know how I can stop it? I've tried setting every row's Selected property to false. Thanks
DatagridView1.Rows(0).Selected = False