I want to display a message when items in DataGridViewComboBox has been changed. I am able to perform it partially by taking help of datagridview CellbeginEdit event and CellEndEdit event but that is not up to mark. I want it as it happen in combobox selection change event.
I had google it for solving but not get appropriate help.
Any help will be appriciated.
use EditingControlShowing event for it
private void grvList_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (grvList.Columns[grvList.CurrentCell.ColumnIndex].Name.Equals("routing_ID"))
{
ComboBox cmbprocess = e.Control as ComboBox;
cmbprocess.SelectedIndexChanged += new EventHandler(grvcmbProcess_SelectedIndexChanged);
}
}
private void grvcmbProcess_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBox cmbprocess = (ComboBox)sender;
if (cmbprocess.SelectedValue != null)
{
/// Your Code goes here
}
}
this is only an example program to show how to do it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With