Skip to main content
Tab

GridViewDataColumnSettings.AllowDragDrop Property

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

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

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

Property Value

Type Default Description
DefaultBoolean Default

One of the enumeration values.

Available values:

Name Description Return Value
True

The value is true.

0

False

The value is false.

1

Default

The value is specified by a global option or a higher-level object.

2

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 (in markup):

<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