Skip to main content
A newer version of this page is available. .
Tab

ASPxGridView.SortBy(GridViewColumn, Int32) Method

Sorts data in ascending order by the values of the specified data column, and places the column to the specified position among the sorted columns.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.1.dll

Declaration

public int SortBy(
    GridViewColumn column,
    int value
)

Parameters

Name Type Description
column GridViewColumn

A GridViewColumn object that represents the column within the ASPxGridView.

value Int32

An integer value that specifies the zero-based column’s index among the sorted columns. -1 if data is not sorted by this column.

Returns

Type Description
Int32

An integer value that specifies the zero-based column’s index among the sorted columns.

Remarks

The ASPxGridView allows data sorting by multiple columns. Any previous sorting is not cleared when calling the SortBy method. The newly sorted column is inserted at the specified position within the collection of sorted columns. Its position within the collection can then be changed using the GridViewDataColumn.SortIndex property.

Sorting is allowed if the ASPxGridBehaviorSettings.AllowSort property is set to true.

See Also