Skip to main content

BootstrapGridView.CustomCellMerge Event

Allows you to merge grid cells manually.

Namespace: DevExpress.Web.Bootstrap

Assembly: DevExpress.Web.Bootstrap.v23.2.dll

NuGet Package: DevExpress.Web.Bootstrap

Declaration

public event BootstrapGridViewCustomCellMergeEventHandler CustomCellMerge

Event Data

The CustomCellMerge event's data class is BootstrapGridViewCustomCellMergeEventArgs. The following properties provide information specific to this event:

Property Description
Column
Handled Specifies if merging of the currently processed cells is handled manually, so no default processing is required. Inherited from ASPxGridViewCustomCellMergeEventArgs.
Merge Specifies if the currently processed cells should be merged. Inherited from ASPxGridViewCustomCellMergeEventArgs.
RowVisibleIndex1 Gets the visible index of the row that contains the first cell currently being processed. Inherited from ASPxGridViewCustomCellMergeEventArgs.
RowVisibleIndex2 Gets the visible index of the row that contains the second cell currently being processed. Inherited from ASPxGridViewCustomCellMergeEventArgs.
Value1 Gets the value of the first cell currently being processed. Inherited from ASPxGridViewCustomCellMergeEventArgs.
Value2 Gets the value of the second cell currently being processed. Inherited from ASPxGridViewCustomCellMergeEventArgs.

Remarks

When cell merging is allowed (by the ASPxGridViewBehaviorSettings.AllowCellMerge or GridViewDataColumnSettings.AllowCellMerge property), the grid automatically merges adjacent cells with the same values.

In this case, you can handle the CustomCellMerge event to implement cell merging manually.

Note

  • The pairs of cells are processed randomly.
  • The event handler won’t process neighbor cells indexes one after another as this event can fire not only for adjacent pairs of cells in a column.

The event argument properties provide information about the processed column (Column), visible index of the rows that contain the processed cells (RowVisibleIndex1 and RowVisibleIndex2), and their values (Value1 and Value2).

To provide custom merging logic, set the Handled property to true and use the Merge property to specify if the currently processed cells should be merged. If the cells are merged, the resulting cell value is equal to Value1.

See Also