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.v19.1.dll

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

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

See Also