FlexGrid for WinForms | ComponentOne
C1.Win.C1FlexGrid Namespace / C1FlexGridBase Class / ComboBoxEditor Property
Example

In This Topic
    ComboBoxEditor Property (C1FlexGridBase)
    In This Topic
    Gets a ComboBoxEditor object that provides easy access to properties of the currently active ComboBox editor.
    Syntax
    'Declaration
     
    
    Public ReadOnly Property ComboBoxEditor As ComboBoxEditor
    public ComboBoxEditor ComboBoxEditor {get;}
    Remarks

    The ComboBoxEditor object can be used to get and set properties on the currently active ComboBox editor without casting the Editor property.

    If no editor is active, or if the editor is not a System.Windows.Forms.ComboBox, these properties return null or -1, and cannot be set.

    Example
    The code below shows two equivalent ways of accessing the selected index of the currently active ComboBox editor:
    // with the ComboBoxEditor property:
    Console.WriteLine("The current combo index is {0}",
        _flex.ComboBoxEditor.SelectedIndex);
                
    // without the ComboBoxEditor property:
    ComboBox cb = _flex.Editor as ComboBox;
    int index = (cb != null) ? cb.SelectedIndex : -1;
    Console.WriteLine("The current combo index is {0}",
        index);
    See Also