It seems to be working so far.
Thanks!
User Profile
Collapse
-
I just tried it and the top leftmost cell is still highlighted. I can't figure why.Leave a comment:
-
How to unselect all cells from a DataGridView?
Hi,
Here's my problem. I have a dataGridview and everytimes I refresh the date from the database, the top leftmost cell (which is a combobox) is always selected. I found a couples of suggestion while searching for a solution :
Code:dataGridView1.ClearSelection();
Code:foreach(DataGridViewRow row in dataGridView1.Rows) { dataFridView1.Rows[row.index].selected=false;
-
Hum... I tried so many things that I forgot to try select on the DGV in that event... it works, thanks!Leave a comment:
-
Here's how I did :
Code:Private void datagridview1_EditingControlShowing(object sender,DataGridViewEditingControlShowingEventArgs e) { Combobox combo=e.control as Combobox; combo.SelectedIndexChanged -=new EventHandler(ComboBox_SelectedIndexChanged); combo.SelectedIndexChanged +=new EventHandler(ComboBox_SelectedIndexChanged); } private void ComboBox_SelectedIndexChanged(object
Leave a comment:
-
How to unselect a combobox in a datagridview
I have a couple of combobox in a datagridview control (winform)
1-I select a new value.
2-I click elsewhere on the form (out of any controls OR out of any cells but inside the DGV control)
If I use my mousewheel, the value of the combobox I just edited may be changed. I would like the combobox to lose focus once I edited it.
I already have an event that is fired when a combobox is changed but after that...
No activity results to display
Show More
Leave a comment: