private void gridView1_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
{
GridView view = sender as GridView;
object val1 = view.GetRowCellValue(e.RowHandle1, "key");
object val2 = view.GetRowCellValue(e.RowHandle2, "key");
e.Merge = (object.Equals(val1, val2) && object.Equals(e.CellValue1, e.CellValue2));
e.Handled = true;
}