Skip to main content

GridViewSettings.CustomCellMerge Property

Enables you to merge grid cells manually.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v24.1.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public ASPxGridViewCustomCellMergeEventHandler CustomCellMerge { get; set; }

Property Value

Type Description
ASPxGridViewCustomCellMergeEventHandler

An ASPxGridViewCustomCellMergeEventHandler delegate method allowing you to implement custom processing.

Remarks

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

CellMerging

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 (ASPxGridViewCustomCellMergeEventArgs.Column), visible index of the rows that contain the processed cells (ASPxGridViewCustomCellMergeEventArgs.RowVisibleIndex1 and ASPxGridViewCustomCellMergeEventArgs.RowVisibleIndex2), and their values (ASPxGridViewCustomCellMergeEventArgs.Value1 and ASPxGridViewCustomCellMergeEventArgs.Value2).

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

See Also