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

CustomColumnSortEventArgs Class

Provides data for the ColumnView.CustomColumnSort and GridView.CustomColumnGroup events.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v18.1.dll

Declaration

public class CustomColumnSortEventArgs :
    EventArgs

Remarks

If a column’s GridColumn.SortMode property is set to ColumnSortMode.Custom the View’s data can be sorted and grouped by this column using custom algorithms. To implement custom sorting and (or) grouping logic, handle the ColumnView.CustomColumnSort and GridView.CustomColumnGroup events. The CustomColumnSortEventArgs class provides data for these events.

In an event handler two rows should be compared. For the ColumnView.CustomColumnSort event the result of the custom comparison indicates whether one row should be positioned above or below another row. For the GridView.CustomColumnGroup event the result of the comparison operation should indicate whether the two rows should be combined into the same group. To set the result of the custom comparison use the CustomColumnSortEventArgs.Result property.

The CustomColumnSortEventArgs.ListSourceRowIndex1 and CustomColumnSortEventArgs.ListSourceRowIndex2 properties also refer to the rows being processed. These define the indexes of the rows in the underlying data source. For instance, you can use row indexes when accessing row values using the methods provided by the data source.

In most cases the CustomColumnSortEventArgs.Handled parameter should be set to true to indicate that the comparison operation was handled and therefore no default processing is required. If the parameter is left set to false the default comparison mechanism will be invoked after your event handler has been called and this will override the custom result.

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

Note

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.

Inheritance

Object
EventArgs
CustomColumnSortEventArgs
See Also