Back to Devexpress

ASPxGridViewResizingSettings.ColumnResizeMode Property

aspnet-devexpress-dot-web-dot-aspxgridviewresizingsettings.md

latest4.4 KB
Original Source

ASPxGridViewResizingSettings.ColumnResizeMode Property

Specifies how columns are resized when a user changes a column’s width.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(ColumnResizeMode.Disabled)]
public ColumnResizeMode ColumnResizeMode { get; set; }
vb
<DefaultValue(ColumnResizeMode.Disabled)>
Public Property ColumnResizeMode As ColumnResizeMode

Property Value

TypeDefaultDescription
ColumnResizeModeDisabled

One of the enumeration values.

|

Available values:

NameDescription
Disabled

End-users are not allowed to resize columns.

| | Control |

When a user resizes a column, the control changes its width and does not resize other columns.

| | NextColumn |

When a user resizes a column, the control changes the width of its neighbor columns. The control’s width is not changed.

|

Property Paths

You can access this nested property as listed below:

LibraryObject TypePath to ColumnResizeMode
ASP.NET MVC ExtensionsGridViewSettings

.SettingsResizing .ColumnResizeMode

| | MVCxGridViewProperties |

.SettingsResizing .ColumnResizeMode

| | ASP.NET Web Forms Controls | ASPxGridView |

.SettingsResizing .ColumnResizeMode

| | GridViewProperties |

.SettingsResizing .ColumnResizeMode

|

Remarks

Users can drag the edges of the column headers to resize columns.

Run Demo: ASPxGridView - Resize columns Run Demo: MVCxGridView - Resize Columns

The ColumnResizeMode property specifies the ASPxGridView control behavior when users resize a column.

Note that the grid requires at least one non-fixed column to resize columns. If all grid columns have fixed widths (in pixels), the most right column’s width becomes relative.

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

To learn more about column resizing, see the following topic: Resize Columns

aspx
<dx:ASPxGridView ID="grid" runat="server" DataSourceID="CustomersDataSource" KeyFieldName="CustomerID" Width="600">
    <Columns>
        ...
    </Columns>
    <SettingsResizing ColumnResizeMode="NextColumn" />
</dx:ASPxGridView>
csharp
grid.SettingsResizing.ColumnResizeMode = ColumnResizeMode.NextColumn;
razor
@Html.DevExpress().GridView(settings => {
    settings.Name = "grid";
    settings.SettingsResizing.ColumnResizeMode = ColumnResizeMode.NextColumn;
    ...
}).Bind(Model).GetHtml()

See Also

Grid View

ASPxGridViewResizingSettings Class

ASPxGridViewResizingSettings Members

DevExpress.Web Namespace