Resize Columns
- 2 minutes to read
Users can resize grid columns.
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.NextColumn
- When users resize a column, the next column’s width also changes to keep the grid’s width the same.
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.
In Postponed
mode, the grid displays a resizable frame during resizing and redraws columns only when the user releases the mouse button.