Anwind
Well-known member
- Joined
- Nov 6, 2021
- Messages
- 48
- Programming Experience
- 1-3
hello.
How to trigger the Enter key event when the Changed event is fired.
Is the source below correct?
How to trigger the Enter key event when the Changed event is fired.
Is the source below correct?
C#:
C# - Datagridview combobox change event
private void dgv_1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
ComboBox combo = e.Control as ComboBox;
if (combo != null)
{
combo.SelectedIndexChanged -= new EventHandler(dgv_1_SelectedIndexChanged);
combo.SelectedIndexChanged += new EventHandler(dgv_1_SelectedIndexChanged);
}
}
private void dgv_em_1_sovp_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBox combo = (ComboBox)sender;
if (combo.SelectedIndex == 0)
{
}
else if (combo.SelectedIndex == 1)
{
}
}