Back to Devexpress

GridDataColumnSettings.AllowSort Property

aspnet-devexpress-dot-web-dot-griddatacolumnsettings.md

latest3.1 KB
Original Source

GridDataColumnSettings.AllowSort Property

Specifies whether a user can sort data by column (or row for ASPxVerticalGrid) values.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(DefaultBoolean.Default)]
public DefaultBoolean AllowSort { get; set; }
vb
<DefaultValue(DefaultBoolean.Default)>
Public Property AllowSort As DefaultBoolean

Property Value

TypeDefaultDescription
DefaultBooleanDefault

True to enable sorting. False to disable sorting. Default to control the column’s behavior at the control level (the ASPxGridBehaviorSettings.AllowSort property).

|

Available values:

NameDescriptionReturn 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

|

Remarks

Specify the AllowSort property to control sorting at the column level.

If the column’s AllowSort property is set to Default, the control determines the column’s behavior at the control level, based on the ASPxGridBehaviorSettings.AllowSort property value.

aspx
<dx:ASPxGridView ID="grid" runat="server" AutoGenerateColumns="false">
    <SettingsBehavior AllowSort="true">
    <Columns>
        <dx:GridViewDataColumn FieldName="ContactName" SortIndex="2" SortOrder="Ascending" >
            <Settings AllowSort="false"/>
        </dx:GridViewDataColumn>
        <%--...--%>
    </Columns>
</dx:ASPxGridView>

For more information on the sort mode in a particular control, refer to the following topics:

Online Demos

Run Demo: ASPxGridView - Sort Data

Run Demo: ASPxCardView - Sorting

Run Demo: ASPxVerticalGrid - Sorting

See Also

GridDataColumnSettings Class

GridDataColumnSettings Members

DevExpress.Web Namespace