Tab
A newer version of this page is available. Switch to the current version.

GridViewDataComboBoxColumn.PropertiesComboBox Property

Gets the column editor's settings.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

public ComboBoxProperties PropertiesComboBox { get; }
Public ReadOnly Property PropertiesComboBox As ComboBoxProperties

Property Value

Type Description
ComboBoxProperties

A ComboBoxProperties object that contains settings specific to a combo box editor.

Remarks

The PropertiesComboBox property allows you to access and customize the settings of the combo box editor.

NOTE

Settings provided by the PropertiesComboBox property affect auto filter row editors. To customize such editors, handle the ASPxGridView.AutoFilterCellEditorInitialize event and use the ASPxGridEditorEventArgs.Editor property to get access to the filter row editor as shown in the code below.


protected void ASPxGridView_AutoFilterCellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) {
    if (e.Column.FieldName == "FIELD_NAME"){
        e.Editor.Width = Unit.Pixel(...);
        ...
    }
}

Example

The following example illustrates how to use the PropertiesComboBox property.

WebForms approach:

NOTE

For a full example, see the ASPxGridView - Customization Dialog demo.


<dx:ASPxGridView ID="Grid" runat="server" DataSourceID="ProductsDataSource" 
    EnableRowsCache="false" Width="100%">
    <Columns>
        <dx:GridViewDataTextColumn FieldName="ProductName">
            <Settings AutoFilterCondition="Contains" />
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataComboBoxColumn FieldName="CategoryID" Caption="Category Name" SortIndex="0" SortOrder="Ascending" AdaptivePriority="1">
            <PropertiesComboBox DataSourceID="CategoriesDataSource" ValueField="CategoryID" TextField="CategoryName" ValueType="System.Int32" />
            <Settings AllowHeaderFilter="True" AllowAutoFilter="False" SortMode="DisplayText" />
            <SettingsHeaderFilter Mode="CheckedList" />
        </dx:GridViewDataComboBoxColumn>
        ...
    </Columns>
</dx:ASPxGridView>

MVC approach:

NOTE

For a full example, see the GridView - Customization Dialog demo.


@Html.DevExpress().GridView(settings => {
    settings.Name = "GridView";
    settings.SettingsCustomizationDialog.Enabled = true;
    ...
    settings.Columns.Add(c => {
        c.FieldName = "ProductName";
        c.Settings.AutoFilterCondition = AutoFilterCondition.Contains;
    });
    settings.Columns.Add(c => {
        c.FieldName = "CategoryID";
        c.Caption = "Category Name";
        c.SortIndex = 0;
        c.SortOrder = DevExpress.Data.ColumnSortOrder.Ascending;
        c.AdaptivePriority = 1;
        c.Settings.AllowHeaderFilter = DefaultBoolean.True;
        c.Settings.AllowAutoFilter = DefaultBoolean.False;
        c.Settings.SortMode = DevExpress.XtraGrid.ColumnSortMode.DisplayText;
        c.SettingsHeaderFilter.Mode = GridHeaderFilterMode.CheckedList;
        c.EditorProperties().ComboBox(cb => {
            cb.DataSource = NorthwindDataProvider.GetCategories();
            cb.TextField = "CategoryName";
            cb.ValueField = "CategoryID";
            cb.ValueType = typeof(int);
        });
    });
}).Bind(Model).GetHtml()
See Also