Possible Duplicate:
Selecting a row in Datagridview Programatically?
I am developing a new desktop application in C# using Windows Forms. In one of my form i put the DataGridView Control
and i am populating this dataGridViewControl
Dynamically using my custom functions.
Now after populating the above control, is there any way to programatically select the first row of that DataGridViewview
. Note: the Selection mode property of this DataGridView is set to "Full row Select"
Try:
dataGridView1.Rows[0].Selected = true;
To select one row in winform DataGridView TRY THIS:
dataGridView1.MultiSelect = false;
dataGridView1.MultiSelect = true;
dataGridView1.Rows[RowIndex].Selected = true;
It works ..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With