ASPxGridViewBehaviorSettings.AllowDragDrop Property
Gets or sets whether end-users can drag column headers.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v19.2.dll
Declaration
Property Value
Type | Default | Description |
---|---|---|
Boolean | **true** | true, to allow end-users to drag column headers; otherwise, false. |
Property Paths
You can access this nested property as listed below:
Library | Object Type | Path to AllowDragDrop |
---|---|---|
ASP.NET Controls and MVC Extensions | ASPxGridView |
|
GridViewProperties |
|
|
GridViewSettings |
|
|
GridViewSettings<RowType> |
|
|
MVCxGridView |
|
|
MVCxGridViewProperties |
|
|
ASP.NET Bootstrap Controls | BootstrapGridView |
|
Remarks
If the AllowDragDrop option is set to true, end users are allowed to:
reorder columns in the customization dialog and the column header panel;
group or ungroup data.
Concept
Example
WebForms (declaratively):
<dx:ASPxGridView ID="ASPxGridView1" runat="server" ...>
...
<SettingsBehavior AllowDragDrop="false" />
<Columns>
<dx:GridViewDataTextColumn FieldName="QuantityPerUnit" VisibleIndex="1">
<Settings AllowDragDrop="True" />
</dx:GridViewDataTextColumn>
...
</Columns>
</dx:ASPxGridView>
WebForms (in code):
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;
MVC:
@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()
Online Demos
WebForms: ASPxGridView - Column Moving
See Also