Skip to main content

Cell Merge

  • 2 minutes to read

The cell merge feature allows your applications to deliver data clarity and avoid duplication by merging neighboring data cells across different rows whenever they display matching values.

cell merging

Cell merge is currently supported only by the Table View in the optimized mode (the TableView.UseLightweightTemplates property is not set to None). To enable the feature, set the view’s TableView.AllowCellMerge property to true. To disable it for certain columns, set their ColumnBase.AllowCellMerge property to false. To specify custom cell merge rules, use the TableView.CellMerge event or TableView.CellMergeCommand property.

The cell merge feature doesn’t prevent you from editing individual cells and supports major data shaping operations including sorting, grouping, and master-detail.



Size differences of UI elements affect the cell merge mechanism. If there are render/measure issues with merged cells, set the UseLayoutRounding property to true at the window level.


The code sample below merges cells in the Order Date column if they have the same month and year:

DevExpress WPF | Grid Control - Custom Cell Merge Rules

<dxg:GridControl ItemsSource="{Binding Orders}">
    <dxg:GridColumn FieldName="OrderDate" AllowCellMerge="True">
            <dxe:DateEditSettings DisplayFormat="MMMM yyyy"/>
    <!-- ... -->
        <dxg:TableView CellMergeCommand="{Binding CellMergeCommand}">
public class ViewModel : ViewModelBase {
    // ...
    public void CellMerge(CellMergeArgs args) {
        if(args.FieldName == nameof(Order.OrderDate)) {
            if(((DateTime)args.FirstCellValue).Month == ((DateTime)args.SecondCellValue).Month 
            && ((DateTime)args.FirstCellValue).Year == ((DateTime)args.SecondCellValue).Year) {
                args.Merge = true;