Skip to main content

CellMergeEventArgs.CellValue2 Property

Gets the value of the second cell processed by the TableView.CellMerge event handler.

Namespace: DevExpress.Xpf.Grid

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

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public object CellValue2 { get; }

Property Value

Type Description
Object

An object that is the value of the second cell.

Remarks

Use the CellMergeEventArgs.CellValue1 and CellValue2 properties to get the values of adjacent cells that are processed by the TableView.CellMerge event handler.

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;
        }
    }
}
See Also