1、设置GridView合并
是否允许合并单元格 默认为false,打开后都会合并
gridView1.OptionsView.AllowCellMerge = true;
?this.gridView1.Columns["ypname"].OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False; ;
方式如下:
1:先设置需要合并的列为允许合并
OptionsView.AllowCellMerge = true;(视图)
??????OptionsColumn.AllowMerge = true; (对应列)
??2:在CellMerge事件中进行判断
?
private void gdvOrder_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
???????{
???????????string t1 = (T)gdvOrder.GetRow(e.RowHandle1); //上一行数据
???????????string t2 = (T)gdvOrder.GetRow(e.RowHandle2); //下一行数据
???????????if (t1.xxx != t2.xxx)
???????????????e.Handled = true;
???????}<br data-filtered="filtered">// T为对应的类