0

我想出了如何在数据网格视图中将事件添加到我的组合框中:

    private void dataGridViewCaseObjects_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
    {
        var combo = e.Control as ComboBox;
        if (combo != null)
        {
            combo.SelectedIndexChanged -= ComboBox_SelectedIndexChanged;
            combo.SelectedIndexChanged += ComboBox_SelectedIndexChanged;
        }
    }

    private void ComboBox_SelectedIndexChanged(object sender, EventArgs e)
    {
        // Actually commit the selected string to combobox 
    }

我如何从这一点强制提交到组合框?

4

0 回答 0