GridOptionsCustomization.AllowSort Property

Gets or sets a value specifying whether end-users can apply data sorting.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v20.1.dll

Declaration

[DefaultValue(true)]
[XtraSerializableProperty]
public virtual bool AllowSort { get; set; }
<DefaultValue(True)>
<XtraSerializableProperty>
Public Overridable Property AllowSort As Boolean

Property Value

Type Default Description
Boolean

true

true if end-users can apply data sorting; otherwise, false.

Property Paths

You can access this nested property as listed below:

Object Type Path to AllowSort
AdvBandedGridView
AdvBandedGridView
BandedGridView
BandedGridView
GridView

Remarks

End-users can apply data sorting in two ways. First, by clicking a column header. The second is by right-clicking a column header and choosing the context menu's Sort Ascending or Sort Descending item. If the AllowSort property value is true, both methods are available. Otherwise, end-users cannot apply data sorting.

If the AllowSort option is enabled, you can specify which column's headers can be clicked to apply data sorting. The desired columns' GridColumn.OptionsColumn property should be used for this purpose.

The column header context menu is available only when the View's GridOptionsMenu.EnableColumnMenu option is enabled. Note that you can control which column headers can invoke this menu. Handle the GridView.PopupMenuShowing event for this purpose. Finally, you can implement custom menu item behavior by handling the GridView.GridMenuItemClick event.

Important note: data grouping requires sorting to be applied. Thus, disabling data sorting results in disabling grouping.

See Also