Hi,
is there an event that fires when the value of a combobox in an DatagridviewComboBoxColumn changes ? Right after picking a new Value from the drop down ?
CellValueChanged fires only if the user leaves the current cell.
I am quite sure that there has to be one but i don`t find it.
Many thanks for your help.
Best Regards
Tom
Hi Tom,
We have a better answer to your question, just do this :
dataGridView1.EditingControlShowing += DataGridView1_EditingControlShowing;
private void DataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if(e.Control is ComboBox)
{
((ComboBox)e.Control).SelectedItemChanged -= Window1_SelectedItemChanged1;
((ComboBox)e.Control).SelectedItemChanged += Window1_SelectedItemChanged1;
}
}
Best,
Kevin (ITG)
Hi Tom,
You can use datagridviewComboBoxColumn.Editor for your event like this
Column2.Editor = new ComboBox();
((ComboBox)datagridviewComboBoxColumn.Editor).SelectedValueChanged += Window1_SelectedItemChanged;
and it work well.
But we have identified an issue when using the DropDownStyle = “Simple” in the Column Editor with a custom editor and we’ll try to get it fixed for the next build
Best,
Kevin (ITG)
Please login first to submit.