Skip to main content
Tab

GridViewColumn.MaxWidth Property

Gets or sets the maximum width of the column.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue(0)]
public virtual int MaxWidth { get; set; }

Property Value

Type Default Description
Int32 0

The column’s maximum width.

Remarks

ASPxGridView allows you to resize columns in the UI or in code if the ASPxGridViewBehaviorSettings.ColumnResizeMode property is set to Control or NextColumn. To resize columns programmatically, use the Width property. You can also specify the MinWidth and MaxWidth properties to specify a range of acceptable width values for the column.

The MaxWidth property specifies the maximum width of an individual column. To specify the maximum width for all grid columns, use the ASPxGridViewSettings.ColumnMaxWidth property.

Note that the MaxWidth property is in effect if you use the fixed table layout in the grid.

Run Demo: Grid Columns - Resizing Columns

Run Demo: Responsive Layout

Concept

Example

<dx:GridViewCommandColumn ShowEditButton="true" Width="50px" />
<dx:GridViewDataTextColumn FieldName="OrderID" Caption="ID" Width="30px" />
<dx:GridViewDataTextColumn FieldName="ProductName" Width="35%" MinWidth="135" />
<dx:GridViewDataTextColumn FieldName="Price" Width="20%" MaxWidth="70" MinWidth="45" />
<dx:GridViewDataTextColumn FieldName="Quantity" Width="20%" MaxWidth="70" MinWidth="62" />
<dx:GridViewDataTextColumn FieldName="Total" Width="25%" MaxWidth="70" MinWidth="50" />
<dx:GridViewCommandColumn ShowDeleteButton="true" Width="50px" />

GridLayout-13

See Also