Skip to main content

MVCxGridViewColumn Class

Represents a column within the GridView.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v24.1.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public class MVCxGridViewColumn :
    GridViewEditDataColumn,
    IDateEditIDResolver

Remarks

Refer to the Columns documentation section to learn about GridView columns.

Example

The following example illustrates how to use the MVCxGridViewColumn class.

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()

Implements

Show 19 items
DevExpress.Web.Internal.IPropertiesDirtyTracker
DevExpress.Web.Internal.IWebControlObject
DevExpress.Web.Design.IDesignTimeCollectionItem
DevExpress.Utils.Design.ICaptionSupport
DevExpress.Web.Design.IDesignTimePropertiesOwner
DevExpress.Web.Internal.IWebColumnsOwner
DevExpress.Web.Data.IWebColumnInfo
DevExpress.Web.FilterControl.IFilterColumn
DevExpress.Web.Internal.IWebGridDataColumnBase
DevExpress.Web.Internal.IWebGridExportColumn
DevExpress.Web.Internal.IWebGridDataColumnAdapterOwner
DevExpress.Web.IDateEditIDResolver
See Also