Tab

ASPxGridViewResizingSettings.ColumnResizeMode Property

Gets or sets a value that specifies how columns are resized when an end-user changes a column's width.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

Declaration

[DefaultValue(ColumnResizeMode.Disabled)]
public ColumnResizeMode ColumnResizeMode { get; set; }

Property Value

Type Default Description
ColumnResizeMode

Disabled

One of the ColumnResizeMode enumeration values.

Available values:

Name Description
Disabled

End-users are not allowed to resize columns.

Control

When an end-user changes a column's width, the widths of other columns are not changed. As a result, the control's width is changed.

ColumnResizing_Control

NextColumn

Changing a column's width changes the next column's width. The control's width isn't changed.

ColumnResizing_NextColumn

Property Paths

You can access this nested property as listed below:

Library Object Type Path to ColumnResizeMode
ASP.NET Controls and MVC Extensions ASPxGridView
.SettingsResizing.ColumnResizeMode
GridViewProperties
.SettingsResizing.ColumnResizeMode
ASP.NET Bootstrap Controls BootstrapGridView
.SettingsResizing.ColumnResizeMode
ASP.NET MVC Extensions GridViewSettings
.SettingsResizing.ColumnResizeMode
GridViewSettings<RowType>
.SettingsResizing.ColumnResizeMode
MVCxGridView
.SettingsResizing.ColumnResizeMode
MVCxGridViewProperties
.SettingsResizing.ColumnResizeMode
MVCxGridViewProperties
.SettingsResizing.ColumnResizeMode

Remarks

End-users can change column widths by dragging the right edges of their headers.

ASPxGridView_ColumnResizing

The ColumnResizeMode property specifies how the ASPxGridView control behaves when an end-user resizes a column. This property accepts one of the following values.

  • Disabled - An end-user cannot resize grid columns.
  • Control - When an end-user changes a column's width, the control's width is changed while the width of other columns stay unaffected.

    ColumnResizing_Control

  • NextColumn - Changing a column's width, changes the next column's width. The control's width isn't changed.

    ColumnResizing_NextColumn

You can access settings related to column resizing using the ASPxGridView.SettingsResizing property.

NOTE

When column resizing is enabled, width dimension properties (such as the grid's ASPxWebControl.Width, its columns' WebColumnBase.Width, etc.) should be specified. To learn more, see the ASPxGridView Fixed Table Layout Specifics (Scrolling and Column Resizing) topic.

Concept

Resize Columns

Example

Web Forms (declaratively):

<dx:ASPxGridView ID="grid" runat="server" DataSourceID="CustomersDataSource" KeyFieldName="CustomerID" Width="600">
    <Columns>
        ...
    </Columns>
    <SettingsResizing ColumnResizeMode="NextColumn" />
</dx:ASPxGridView>

Web Forms (in code):

grid.SettingsResizing.ColumnResizeMode = ColumnResizeMode.NextColumn;

MVC:

@Html.DevExpress().GridView(settings => {
    settings.Name = "grid";
    settings.SettingsResizing.ColumnResizeMode = ColumnResizeMode.NextColumn;
    ...
}).Bind(Model).GetHtml()

Online Demos

See Also