Back to Devexpress

ASPxGridViewBehaviorSettings.ColumnMoveMode Property

aspnet-devexpress-dot-web-dot-aspxgridviewbehaviorsettings-8f78e59e.md

latest3.9 KB
Original Source

ASPxGridViewBehaviorSettings.ColumnMoveMode Property

Gets or sets a value that defines how ASPxGridView columns can be rearranged using drag-and-drop.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(GridColumnMoveMode.AmongSiblings)]
public GridColumnMoveMode ColumnMoveMode { get; set; }
vb
<DefaultValue(GridColumnMoveMode.AmongSiblings)>
Public Property ColumnMoveMode As GridColumnMoveMode

Property Value

TypeDefaultDescription
GridColumnMoveModeAmongSiblings

One of the GridColumnMoveMode enumeration values.

|

Available values:

NameDescription
AmongSiblings

Grid columns and bands are only allowed to move within their parent band.

| | ThroughHierarchy |

Grid columns and bands are allowed to move between parents and hierarchy levels organizing Data Cell Bands.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to ColumnMoveMode
ASPxGridView

.SettingsBehavior .ColumnMoveMode

| | GridViewProperties |

.SettingsBehavior .ColumnMoveMode

|

Remarks

Use the ColumnMoveMode property to specify how an end-user can customize the grid column’s layout using drag-and-drop.

Two modes are available:

  • In the AmongSiblings mode, you can move grid columns within their parent band. When you mode a parent band, it is moved with all its children.

  • In the ThroughHierarchy mode, you can move columns and bands between parents and hierarchy levels. This mode enables end-users to group columns in Data Cell Bands.

Concept

Move Columns

Example

Web Forms (in markup):

aspx
<dx:ASPxGridView ID="ASPxGridView1" runat="server" ...>
    <SettingsBehavior ColumnMoveMode="ThroughHierarchy" />
    ...
</dx:ASPxGridView>

Web Forms (in code):

csharp
ASPxGridView grid1 = new ASPxGridView();
grid1.ID = "grid1";
Page.Form.Controls.Add(grid1);
...
grid1.SettingsBehavior.ColumnMoveMode = GridColumnMoveMode.ThroughHierarchy;

MVC:

csharp
@Html.DevExpress().GridView(settings => {
    settings.Name = "grid";
    settings.SettingsBehavior.ColumnMoveMode = GridColumnMoveMode.ThroughHierarchy;
    ...
}).Bind(Model).GetHtml()

Online Demos

See Also

Grid View

Online Demo: Column Moving

ASPxGridViewBehaviorSettings Class

ASPxGridViewBehaviorSettings Members

DevExpress.Web Namespace