Skip to main content

GridOptionsCustomization.AllowSort Property

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

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v24.1.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation


public virtual bool AllowSort { get; set; }

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
.OptionsCustomization .AllowSort


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.

The following code snippets (auto-collected from DevExpress Examples) contain references to the AllowSort property.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also