.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET 5.0+

IModelColumn.Width Property

Specifies the width of the current column, in pixels.

Namespace: DevExpress.ExpressApp.Model

Assembly: DevExpress.ExpressApp.v21.2.dll

Declaration

int Width { get; set; }

Property Value

Type Description
Int32

An integer value specifying the current column width in pixels.

Remarks

WinForms UI

Column width in XtraGrid is controlled by the GridOptionsView.ColumnAutoWidth property, so actual column width can differ from the Width property value.

ASP.NET Web Forms UI

In ASP.NET Web XAF applications, this property has no effect because the web browser determines column widths based on the styles defined in the current theme and displayed content.

ASP.NET Core Blazor UI

Use the Width property to set a data grid column width. This property value is passed to the actual ASP.NET Core Blazor GridControl’s DxDataColumnBase.Width property.

You can set the ColumnResizeMode property to NextColumn or Component in the DataGrid component settings to allow users to resize columns.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Width property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also