GridViewDataColumnSettings.AllowDragDrop Property
Gets or sets whether end-users can drag the column’s header.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
Declaration
Property Value
Type | Default | Description |
---|---|---|
DefaultBoolean | Default | One of the enumeration values. |
Available values:
Name | Description | Return Value |
---|---|---|
True | The value is true. |
|
False | The value is false. |
|
Default | The value is specified by a global option or a higher-level object. |
|
Property Paths
You can access this nested property as listed below:
Object Type | Path to AllowDragDrop |
---|---|
GridViewDataColumn |
|
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
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
Web Forms: ASPxGridView - Column Moving
See Also