ASPxCardView.CustomColumnGroup Event
Provides the capability to group cards using custom rules.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
NuGet Package: DevExpress.Web
#Declaration
public event ASPxCardViewCustomColumnSortEventHandler CustomColumnGroup
#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 Grid |
List |
Gets the index in the data source of the first of the two data items (row, card or record) being compared.
Inherited from Grid |
List |
Gets the index in the data source of the second of the two data items (row, card or record) being compared.
Inherited from Grid |
Result |
Gets or sets the result of a custom comparison.
Inherited from Grid |
Sort |
Gets the sort order applied to the column (row for ASPx |
Value1 |
Gets the first value being compared.
Inherited from Grid |
Value2 |
Gets the second value being compared.
Inherited from Grid |
The event data class exposes the following methods:
Method | Description |
---|---|
Get |
Returns the specified column’s value in the first data item (row, card or record) being compared.
Inherited from Grid |
Get |
Returns the specified column’s value in the second data item (row, card or record) being compared.
Inherited from Grid |
#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 Custom
In addition, handling of the ASPx
Note
In server mode, cards are always grouped by values of grouping columns.