Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

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);
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# file to byte array 
Csharp :: disable version header c# 
Csharp :: use c#9 
Csharp :: boxing and unboxing in c# 
Csharp :: c# datagridview cell align center 
Csharp :: c# xml check if attribute exists 
Csharp :: faucongz 
Csharp :: self referencing loop detected for property entity framework 
Csharp :: Severity Code Description Project File Line Suppression State Error MSB3021 
Csharp :: base c# 
Csharp :: unity find deactivated gameobject 
Csharp :: Generic Stack in c# 
Csharp :: runtime save scene unity 
Csharp :: how to return array in function c# 
Csharp :: c# catch two exceptions in one block 
Csharp :: c# interface property 
Csharp :: c# sc create service 
Csharp :: restrictions 
Csharp :: c# sort llist 
Csharp :: c# list initialize 
Csharp :: Create a list of 3 Orders c# 
Csharp :: unity image button 
Csharp :: Delayed respawn timer 
Csharp :: converting dens_rank and row_number to linq 
Csharp :: print bitmap company logo c sharp 
Csharp :: how to change the color of a textbox with button c# 
Csharp :: ASP.NET C# Catch all exceptions in a class 
Csharp :: how to add extra window to wpf 
Csharp :: .net entities query multiple join condition type inference 
Csharp :: c# entity framework order by array 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =