ASPxCardView.CustomColumnGroup Event
Provides the capability to group cards using custom rules.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
Event Data
The CustomColumnGroup event's data class is CardViewCustomColumnSortEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Column | Gets the column whose values are being compared. |
Handled | Gets or sets whether a comparison operation is handled, and therefore, no default processing is required. Inherited from GridCustomColumnSortEventArgs. |
ListSourceRowIndex1 | Gets the index in the data source of the first of the two data items (row, card or record) being compared. Inherited from GridCustomColumnSortEventArgs. |
ListSourceRowIndex2 | Gets the index in the data source of the second of the two data items (row, card or record) being compared. Inherited from GridCustomColumnSortEventArgs. |
Result | Gets or sets the result of a custom comparison. Inherited from GridCustomColumnSortEventArgs. |
SortOrder | Gets the sort order applied to the column (row for ASPxVerticalGrid) being processed. Inherited from GridCustomColumnSortEventArgs. |
Value1 | Gets the first value being compared. Inherited from GridCustomColumnSortEventArgs. |
Value2 | Gets the second value being compared. Inherited from GridCustomColumnSortEventArgs. |
The event data class exposes the following methods:
Method | Description |
---|---|
GetRow1Value(String) | Returns the specified column’s value in the first data item (row, card or record) being compared. Inherited from GridCustomColumnSortEventArgs. |
GetRow2Value(String) | Returns the specified column’s value in the second data item (row, card or record) being compared. Inherited from GridCustomColumnSortEventArgs. |
Remarks
Handle the CustomColumnGroup event to implement custom logic for grouping. This event is fired when a column’s ASPxGridBehaviorSettings.SortMode property is set to ‘Custom’ and the ASPxCardView’s cards are grouped by this column.
Each time the CustomColumnGroup event is fired, two adjacent cards are compared. If the cards should be combined into the same group, set the GridCustomColumnSortEventArgs.Result parameter to 0. Otherwise, set it to 1 (or -1). The GridCustomColumnSortEventArgs.Handled parameter must be set to true
, to indicate that the current comparison was handled, and no default processing is required. If this parameter is left false
, the cards will be compared using the default comparison mechanism.
The column by which grouping is applied is identified by the CustomColumnSortEventArgs.Column parameter. The values in the cards that are being compared are specified by the GridCustomColumnSortEventArgs.Value1 and GridCustomColumnSortEventArgs.Value2 parameters.
To replace the default text displayed within group rows, handle the ASPxCardView.CustomGroupDisplayText event.
Note
Since grouping logic is closely coupled with the card view’s sorting logic, and its functionally based on it, it is required to handle both the CustomColumnGroup and ASPxCardView.CustomColumnSort events in a similar manner to correctly implement custom grouping. Otherwise (if only a single CustomColumnGroup event is handled), sorting of the grouped columns might not work correctly in some scenarios.
In addition, handling of the ASPxCardView.CustomGroupDisplayText event might be required to replace the default text displayed within group rows with custom content.
Note
In server mode, cards are always grouped by values of grouping columns.