Skip to main content

Resize Columns

  • 2 minutes to read

Users can resize grid columns.

ASPxGridView_ColumnResizing

Run Demo: ASPxGridView - Resize columns Run Demo: MVCxGridView - Resize Columns Read Tutorial: ASPxGridView Fixed Table Layout Specifics (Scrolling and Column Resizing)

If you resize columns whose widths are in percentage values, the grid converts the widths to pixels.

The ASPxGridView.SettingsResizing property provides access to the column resize settings.

Use the ASPxGridViewResizingSettings.ColumnResizeMode property to specify the resize mode.

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

You can set this property to the following values:

  • Disabled - Users cannot resize grid columns.

  • Control - The grid changes its width when users resize a column. In this case, the other columns remain fixed.

    ColumnResizing_Control

  • NextColumn - When users resize a column, the next column’s width also changes to keep the grid’s width the same.

    ColumnResizing_NextColumn

When the ShowColumnHeaders property is set to false, the ColumnResizeMode property is ignored and column resizing is disabled.

The ASPxGridViewResizingSettings.Visualization property specifies the columns’ redraw mode.

<dx:ASPxGridView ID="grid" runat="server" ...>
    ...
    <SettingsResizing Visualization="Postponed" />
</dx:ASPxGridView>

In Live mode, the grid redraws its columns continuously when users resize columns.

ASPxGridView-LiveColumnResizing

In Postponed mode, the grid displays a resizable frame during resizing and redraws columns only when the user releases the mouse button.

ASPxGridView-PostponeColumnResizing