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

GridViewDataColumnSettings.AllowDragDrop Property

Gets or sets whether end-users can drag the column’s header.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v21.2.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue(DefaultBoolean.Default)]
public DefaultBoolean AllowDragDrop { get; set; }

Property Value

Type Default Description
DefaultBoolean Default

One of the DefaultBoolean enumeration values.

Available values:

Name Description
True

true. DefaultBoolean.True has a constant value of 0, while the standard true value corresponds to a value of 1. In Visual Basic, do not use implicit conversion of Boolean values to DefaultBoolean, and vice versa, as the conversion may produce incorrect results.

False

false. DefaultBoolean.False has a constant value of 1, while the standard false value corresponds to a value of 0. In Visual Basic, do not use implicit conversion of Boolean values to DefaultBoolean, and vice versa, as the conversion may produce incorrect results.

Default

The default behavior determined by the control’s logic.

Property Paths

You can access this nested property as listed below:

Object Type Path to AllowDragDrop
GridViewDataColumn
.Settings .AllowDragDrop

Remarks

If the AllowDragDrop property is set to DefaultBoolean.Default, the column’s behavior is controlled by the ASPxGridView’s ASPxGridViewBehaviorSettings.AllowDragDrop property.

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