[Solved]ComboBox DatagridViewColumn

Answered
0
0

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

  • You must to post comments
Great Answer
0
0

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)

  • Tom Oeben
    Thats it. Found the Same Solution today. Many thx for your help
  • You must to post comments
0
0

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)

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.