导航

CellMerge

Posted on 2012-08-04 18:40  毅无涯  阅读(697)  评论(0编辑  收藏  举报

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