Answers for "DataGridView ComboBox column selection changed event"

C#
0

DataGridView ComboBox column selection changed event

private void Grid_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
    if(((DataGridView)sender).CurrentCell.ColumnIndex == 0) //Assuming 0 is the index of the ComboBox Column you want to show
    {
        ComboBox cb = e.Control as ComboBox;
        if (cb!=null)
        {
            cb.SelectionChangeCommitted -= new EventHandler(cb_SelectedIndexChanged);
            // now attach the event handler
            cb.SelectionChangeCommitted += new EventHandler(cb_SelectedIndexChanged);
        }
    }
}
Posted by: Guest on May-05-2022

Code answers related to "DataGridView ComboBox column selection changed event"

C# Answers by Framework

Browse Popular Code Answers by Language