Skip to main content
Tab

GridViewDataComboBoxColumn Class

A combo box column in the Grid View control.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

public class GridViewDataComboBoxColumn :
    GridViewEditDataColumn

Remarks

When the Grid View control is in edit mode, a combo box column displays a drop-down menu. Users can select one of the items displayed in this menu.

ComboBoxColumn_result

Note

Combo box columns are not supported in database server mode.

To bind a combo box column to a data source field, assign the field name to the column’s FieldName property. The column’s PropertiesComboBox property allows you to access and configure combo box editor settings. Configure the following settings to bind the combo box editor to a data source:

DataSource or DataSourceID
Allows you to bind the combo box editor to a data source.
ValueField
Specifies the data source field that contains combo box editor item values.
ValueType
Specifies the data type of the combo box editor values.
TextField
Specifies the data source field that contains the text strings displayed by the drop-down window.

Example

The following code example demonstrates how to bind the combo box column to a data source:

<dx:ASPxGridView ID="Grid" runat="server" DataSourceID="DataSource" KeyFieldName="ProductID">
    <Columns>
        <!-- ... -->
        <dx:GridViewDataComboBoxColumn FieldName="CategoryID" Caption="Category Name">
            <PropertiesComboBox DataSourceID="CategoriesDataSource"
                                ValueType="System.Int32"
                                ValueField="CategoryID"
                                TextField="CategoryName" />
        </dx:GridViewDataComboBoxColumn>
    </Columns>
    <!-- ... -->
</dx:ASPxGridView>

Run Demo: ASPxGridView — Batch Editing Run Demo: MVCxGridView — Batch Editing

See Also