Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

CellMergeEventArgs Class

Provides data for the TableView.CellMerge event.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v24.2.dll

NuGet Package: DevExpress.Wpf.Grid.Core

#Declaration

public class CellMergeEventArgs :
    EventArgs

#Remarks

To learn more, see Cell Merging.

The following example demonstrates a TableView.CellMerge event handler that merges the cells in the text column regardless of the string case.

private void tableView_CellMerge(object sender, CellMergeEventArgs e) {
    bool isDepartment =  e.Column.FieldName == "Department";
    if (isDepartment) {
        string str1 = e.CellValue1 as string;
        string str2 = e.CellValue2 as string;
        bool equalIgnoreCase = String.Equals(str1, str2, StringComparison.OrdinalIgnoreCase);
        if(equalIgnoreCase) {
            e.Merge = true;
            e.Handled = true;
        }
    }
}

#Inheritance

Object
EventArgs
CellMergeEventArgs
See Also