DataGridView combobox cell event in C #

I want to display a message when the items in the DataGridViewComboBox have changed. I can partially execute it using the help of the CellbeginEdit datagridview event event and the CellEndEdit event, but this does not match the value. I want this to happen in the combobox selection change event.

I had Google for the solution, but did not receive the appropriate help.

Any help would be assigned.

+6
source share
1 answer

use the EditingControlShowing event for this

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 just an example program showing how to do this

+7
source

Source: https://habr.com/ru/post/903892/


All Articles