Skip to main content
.NET 8.0+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

IModelColumn.Width Property

Specifies the width of the current column, in pixels.

Namespace: DevExpress.ExpressApp.Model

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

#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. If a ListView has many columns, their captions and content may be truncated. In this case, set the GridOptionsView.ColumnAutoWidth property to false to show a horizontal scrollbar. For information on how to access the Grid Control settings, refer to the following article: How to: Access the Grid Component in a List View.

#ASP.NET Web Forms UI

In ASP.NET Web Forms 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 grid column width. This property value is passed to the actual ASP.NET Core Blazor Grid Control’s DxGridColumn.Width property in pixels.

When this property is not specified in the Model Editor, grid columns evenly occupy the whole grid width. When this property is set for a part of grid columns, other columns are resized according to the available space. When it is set for all columns, the grid control either displays a horizontal scrollbar or an empty space. This also happens after resizing columns in the Columns node designer (List View Columns Customization) and at runtime.

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