GridViewDataColumnSettings.AllowDragDrop Property
Gets or sets whether end-users can drag the column’s header.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v19.1.dll
Declaration
Property Value
Type | Default | Description |
---|---|---|
DefaultBoolean | **Default** | One of the DefaultBoolean enumeration values. |
Available values:
Name | Description |
---|---|
True | Corresponds to a Boolean value of true. |
False | Corresponds to a Boolean value of false. |
Default | The value is determined by the current object’s parent object setting (e.g., a control setting). |
Property Paths
You can access this nested property as listed below:
Remarks
If the AllowDragDrop property is set to DefaultBoolean.Default, the column’s behavior is controlled by the ASPxGridView’s ASPxGridViewBehaviorSettings.AllowDragDrop property.
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