Skip to main content
A newer version of this page is available. .
Tab

ASPxGridViewBehaviorSettings.AllowDragDrop Property

Gets or sets whether end-users can drag column headers.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v21.1.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue(true)]
public bool AllowDragDrop { get; set; }

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 Bootstrap Controls BootstrapGridView
.SettingsBehavior .AllowDragDrop
ASP.NET MVC Extensions GridViewSettings
.SettingsBehavior .AllowDragDrop
GridViewSettings<RowType>
.SettingsBehavior .AllowDragDrop
MVCxGridView
.SettingsBehavior .AllowDragDrop
MVCxGridViewProperties
.SettingsBehavior .AllowDragDrop
ASP.NET Web Forms Controls ASPxGridView
.SettingsBehavior .AllowDragDrop
GridViewProperties
.SettingsBehavior .AllowDragDrop

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

Move Columns

Example

Web Forms (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>

Web Forms (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

See Also