I have a dataGridView control in Window Form Application. Three columns are added to the dataGridView. I added 20 empty rows into dataGridView in order to show some blank cells.(Otherwise dataGridView just shows grey area).
On dataGridView control, I add three column "a","b", "c". In form load, I add this,
dataGridView1.Rows.Add(20);
after form initialize, datagridview shows some blank cell, but first cell in first row is selected(highlighted with blue color). Please note, there is no data in datagridview. I could not figure out how to clear the default selection.
I did some research. There are some discussion. I tried, ,and they were not working. I think it is because I don't have data in the control. But the method mentioned in the following link, is for a datagridview loaded with data.
Disable default cell selection in datagridView
disable window gridview get focus on first row
Also there are some discussion regarding Windows store application. (I am using windows form application)
how to prevent autoselection of first item in GridView on databind?
Thanks in advance if you can give me some ideas.
MultiSelect
to false before and reset it afterwards.. – TaW