Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

Event that fires during DataGridViewComboBoxColumn SelectedIndexChanged

private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
    {
        if (dataGridView1.CurrentCell.ColumnIndex == 1 && e.Control is ComboBox)
        {
            ComboBox comboBox = e.Control as ComboBox;
            comboBox.SelectedIndexChanged -= LastColumnComboSelectionChanged;
            comboBox.SelectedIndexChanged += LastColumnComboSelectionChanged;
        }
    }

    private void LastColumnComboSelectionChanged(object sender, EventArgs e)
    {
        var currentcell = dataGridView1.CurrentCellAddress;
        var sendingCB = sender as DataGridViewComboBoxEditingControl;
        DataGridViewTextBoxCell cel = (DataGridViewTextBoxCell)dataGridView1.Rows[currentcell.Y].Cells[0];
        cel.Value = sendingCB.EditingControlFormattedValue.ToString();
    }
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to pass value to anothe form c# winform 
Csharp :: OIUJHKJHSKAL::KSAJ 
Csharp :: how to reference a local file c# 
Csharp :: finding holydays asp.net 
Csharp :: declare a delegate 
Csharp :: how download file from internet and move it to folder with c# 
Csharp :: how to write a ello world program in c# 
Csharp :: edit form item from class C# 
Csharp :: c# is file closed 
Csharp :: .net new template 
Csharp :: entity framework get all 
Csharp :: c# get or create firewall inbound rule ports 
Csharp :: visibility bound to radio button wpf 
Csharp :: c# core deploy on gcp with powershell 
Csharp :: vb.net check operating system 
Csharp :: particles are pink - creating tex and material 
Csharp :: how to make game restart when player touches a object unity 
Csharp :: convert console app to linux 
Csharp :: Appending to an Existing CSV File with csvhelper 
Csharp :: parallelism in c# 
Csharp :: asp.net mvc select from many to many relationship 
Csharp :: how to get odd saturday in a month in c# 
Csharp :: ########## 
Csharp :: simplified if statement c# 
Csharp :: how to initialize array in c# 
Csharp :: Filter list contents with predicate (Lambda) 
Csharp :: beard styles without mustache Intitle:work with me 
Csharp :: ascx access parent master page 
Csharp :: you have the following c# code. stringbuilder sb = new stringbuilder(really long string); the really long string variable is a string in which a very long string is stored. 
Csharp :: nunjucks if variable exists 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =