aspnet-devexpress-dot-web-dot-aspxgridviewbehaviorsettings.md
Specifies whether users can rearrange column headers.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
[DefaultValue(true)]
public bool AllowDragDrop { get; set; }
<DefaultValue(True)>
Public Property AllowDragDrop As Boolean
| Type | Default | Description |
|---|---|---|
| Boolean | true |
true, to allow users to rearrange column headers; otherwise, false.
|
You can access this nested property as listed below:
| Object Type | Path to AllowDragDrop |
|---|---|
| ASPxGridView |
.SettingsBehavior .AllowDragDrop
| | GridViewProperties |
.SettingsBehavior .AllowDragDrop
|
The AllowDragDrop option affects the user’s ability to perform the following actions:
You can use the following properties to control this behavior at the column level:
To learn more, refer to the following topic: Move Columns.
Run Demo: Web Forms ASPxGridView - Column Moving
Run Demo: MVC GridView - Column Moving
<dx:ASPxGridView ID="ASPxGridView1" runat="server" ...>
...
<SettingsBehavior AllowDragDrop="false" />
<Columns>
<dx:GridViewDataTextColumn FieldName="QuantityPerUnit" VisibleIndex="1">
<Settings AllowDragDrop="True" />
</dx:GridViewDataTextColumn>
...
</Columns>
</dx:ASPxGridView>
ASPxGridView grid1 = new ASPxGridView();
grid1.ID = "grid1";
Page.Form.Controls.Add(grid1);
...
grid1.SettingsBehavior.AllowDragDrop = DevExpress.Utils.DefaultBoolean.False;
GridViewDataTextColumn productColumn = new GridViewDataTextColumn();
productColumn.FieldName = "QuantityPerUnit";
productColumn.Settings.AllowDragDrop = DevExpress.Utils.DefaultBoolean.True;
@Html.DevExpress().GridView(settings => {
settings.Name = "grid";
settings.SettingsBehavior.AllowDragDrop = DevExpress.Utils.DefaultBoolean.False;
GridViewDataTextColumn productColumn = new GridViewDataTextColumn();
productColumn.FieldName = "QuantityPerUnit";
productColumn.Settings.AllowDragDrop = DevExpress.Utils.DefaultBoolean.True;
...
}).Bind(Model).GetHtml()
See Also
ASPxGridViewBehaviorSettings Class