WinForms

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridComboBoxColumn - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class GridComboBoxColumn

    Represents a column that used to display the SfComboBox as the edit element.

    Inheritance
    System.Object
    SfGridColumnBase<TableControl>
    GridColumnBase
    GridColumn
    GridComboBoxColumn
    Implements
    System.IDisposable
    IFilterDefinition
    Inherited Members
    GridColumn.ToString()
    GridColumn.SetCellType(String)
    GridColumn.CellType
    GridColumn.Renderer
    GridColumn.TableControl
    GridColumnBase.Dispose(Boolean)
    GridColumnBase.AllowTextWrapping
    GridColumnBase.TextTrimming
    GridColumnBase.AllowHeaderTextWrapping
    GridColumnBase.ShowToolTip
    GridColumnBase.ShowHeaderToolTip
    GridColumnBase.AllowGrouping
    GridColumnBase.AllowDragging
    GridColumnBase.CellStyle
    GridColumnBase.AllowFiltering
    GridColumnBase.AllowResizing
    GridColumnBase.Visible
    GridColumnBase.AllowFocus
    GridColumnBase.HeaderStyle
    GridColumnBase.Width
    GridColumnBase.HeaderText
    GridColumnBase.AllowSorting
    GridColumnBase.IsAutoGenerated
    GridColumnBase.MappingName
    GridColumnBase.AutoSizeColumnsMode
    GridColumnBase.ActualWidth
    GridColumnBase.MinimumWidth
    GridColumnBase.MaximumWidth
    GridColumnBase.FilterMode
    GridColumnBase.ColumnMemberType
    GridColumnBase.FilterBehavior
    GridColumnBase.FilteredFrom
    GridColumnBase.ImmediateUpdateColumnFilter
    GridColumnBase.AllowBlankFilters
    GridColumnBase.FilterPopupMode
    GridColumnBase.AdvancedFilterType
    GridColumnBase.FilterPredicates
    GridColumnBase.Format
    GridColumnBase.FormatProvider
    GridColumnBase.NullDisplayText
    GridColumnBase.GroupMode
    GridColumnBase.SortMode
    GridColumnBase.AllowEditing
    GridColumnBase.ValidationMode
    GridColumnBase.FilterRowEditorType
    GridColumnBase.FilterRowCondition
    GridColumnBase.ShowFilterRowOptions
    GridColumnBase.FilterRowText
    GridColumnBase.EnableCaseSensitiveFilterRow
    GridColumnBase.EnableCaseSensitiveFiterRow
    GridColumnBase.HeaderImage
    GridColumnBase.AllowHeaderTextWithImage
    GridColumnBase.HeaderTextImageRelation
    SfGridColumnBase<TableControl>.Dispose()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.WinForms.DataGrid
    Assembly: Syncfusion.SfDataGrid.WinForms.dll
    Syntax
    public class GridComboBoxColumn : GridColumn, IDisposable, IFilterDefinition

    Constructors

    GridComboBoxColumn()

    Initializes a new instance of the GridComboBoxColumn class.

    Declaration
    public GridComboBoxColumn()

    Properties

    AllowNull

    Gets or sets a value indicating whether the null values are allowed in the column or not.

    Declaration
    [Cloneable(true)]
    public bool AllowNull { get; set; }
    Property Value
    Type Description
    System.Boolean

    AutoCompleteMode

    Gets or sets the AutoCompleteMode of the ComboBox.

    Declaration
    public AutoCompleteMode AutoCompleteMode { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.AutoCompleteMode

    AutoSuggestDelay

    Gets or sets a value indicating the delay for auto suggestion.

    Declaration
    public int AutoSuggestDelay { get; set; }
    Property Value
    Type Description
    System.Int32

    AutoSuggestMode

    Gets or sets a valuee indicating the AutoSuggestMode of ComboBox.

    Declaration
    public AutoCompleteSuggestMode AutoSuggestMode { get; set; }
    Property Value
    Type Description
    AutoCompleteSuggestMode

    DataSource

    Gets or sets the data source of the ComboBox.

    Declaration
    public object DataSource { get; set; }
    Property Value
    Type Description
    System.Object
    Examples

    The following example shows how to set the DataSource for combo box column.

    // Declare the SfDataGrid control.
    private Syncfusion.WinForms.DataGrid.SfDataGrid sfDataGrid;
    // Initialize the SfDataGrid.
    private void InitializeDataGrid()
    {
        // Create a new SfDataGrid control and set the location and size.
        this.sfDataGrid = new Syncfusion.WinForms.DataGrid.SfDataGrid();
        this.sfDataGrid.Location = new System.Drawing.Point(10, 5);
        this.sfDataGrid.Size = new System.Drawing.Size(750, 450);
    
        // Create a new GridComboBoxColumn and set the DataSource for combo box column.
        GridComboBoxColumn gridComboBoxColumn = new GridComboBoxColumn();
        gridComboBoxColumn.MappingName = "ShipCityID";
        gridComboBoxColumn.HeaderText = "Ship City";
        gridComboBoxColumn.ValueMember = "ShipCityID";
        gridComboBoxColumn.DisplayMember = "ShipCityName";
        gridComboBoxColumn.DropDownStyle = DropDownStyle.DropDownList;
        gridComboBoxColumn.DataSource = orderInfo.ShipCityDetails;
    
        // Added the columns to the SfDataGrid.
        this.sfDataGrid.Columns.Add(gridComboBoxColumn);
        this.sfDataGrid.Columns.Add(new GridNumericColumn() { MappingName = "OrderID", HeaderText = "Order ID" });
        this.sfDataGrid.Columns.Add(new GridTextColumn() { MappingName = "CustomerID", HeaderText = "Customer ID" });
        this.sfDataGrid.Columns.Add(new GridDateTimeColumn() { MappingName = "OrderDate", HeaderText = "Order Date" });
    
        // Set the tab index and add the SfDataGrid to the form.
        this.sfDataGrid.TabIndex = 0;
        this.Controls.Add(this.sfDataGrid);
    }

    DisplayMember

    Gets or sets the DisplayMember of the ComboBox.

    Declaration
    public string DisplayMember { get; set; }
    Property Value
    Type Description
    System.String

    DropDownStyle

    Gets or sets a value indicating whether the ComboBox is editable or not.

    Declaration
    public DropDownStyle DropDownStyle { get; set; }
    Property Value
    Type Description
    DropDownStyle

    IDataSourceSelector

    Gets or sets the DataSource selector for the individual ComboBox cells.

    Declaration
    public IDataSourceSelector IDataSourceSelector { get; set; }
    Property Value
    Type Description
    IDataSourceSelector

    StaysOpenOnEdit

    Gets or sets a value indicating whether the DropDown should open on editing.

    Declaration
    public bool StaysOpenOnEdit { get; set; }
    Property Value
    Type Description
    System.Boolean

    ValueMember

    Gets or sets the ValueMember of the ComboBox.

    Declaration
    public string ValueMember { get; set; }
    Property Value
    Type Description
    System.String

    Methods

    GetDisplayValue(Object, String, Object)

    Gets the display value of the ComboBox.

    Declaration
    public static object GetDisplayValue(object dataSource, string displayMember, object item)
    Parameters
    Type Name Description
    System.Object dataSource

    The dataSource of the combo box.

    System.String displayMember

    The display member of combo box.

    System.Object item

    The row item object.

    Returns
    Type Description
    System.Object

    Returns the display value of the combo box.

    GetFormattedValue(Object, Object)

    Overridden to get the formatted display text.

    Declaration
    protected override object GetFormattedValue(object record, object value)
    Parameters
    Type Name Description
    System.Object record

    A record value.

    System.Object value

    Display text value.

    Returns
    Type Description
    System.Object

    Returns the formatted value.

    Overrides
    GridColumnBase.GetFormattedValue(Object, Object)

    GetItemValue(Object, String, Object)

    Gets the value of the combo box.

    Declaration
    public static object GetItemValue(object dataSource, string valueMember, object item)
    Parameters
    Type Name Description
    System.Object dataSource

    The DataSource.

    System.String valueMember

    The value member.

    System.Object item

    The row object.

    Returns
    Type Description
    System.Object

    Returns the value of the combo box.

    Implements

    System.IDisposable
    IFilterDefinition
    Back to top Generated by DocFX
    Copyright © 2001 - 2022 Syncfusion Inc. All Rights Reserved