protected void Grid_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { for (int i = 0; i < e.Row.Cells.Count - 1; i++) { DevExpress.Web.Rendering.GridViewTableDataCell dataCell1 = e.Row.Cells[i] as DevExpress.Web.Rendering.GridViewTableDataCell; DevExpress.Web.Rendering.GridViewTableDataCell dataCell2 = e.Row.Cells[i + 1] as DevExpress.Web.Rendering.GridViewTableDataCell; if (dataCell1 != null && dataCell2 != null) { string fieldName1 = dataCell1.DataColumn.FieldName; string fieldName2 = dataCell2.DataColumn.FieldName; if (IsSameData(e.VisibleIndex, fieldName1, fieldName2)) { if (mergedCell == null) { mergedCell = e.Row.Cells[i]; } if (!cellColumnSpans.ContainsKey(mergedCell)) { cellColumnSpans[mergedCell] = 1; } cellColumnSpans[mergedCell]++; cellsToRemove.Add(e.Row.Cells[i + 1]); } else { mergedCell = null; } } } RemoveUnnecessaryCells(e.Row); }
public void grid_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { if (Grid.GetRowLevel(e.VisibleIndex) != Grid.GroupCount) { return; } for (int i = e.Row.Cells.Count - 1; i >= 0; i--) { DevExpress.Web.Rendering.GridViewTableDataCell dataCell = e.Row.Cells[i] as DevExpress.Web.Rendering.GridViewTableDataCell; if (dataCell != null) { MergeCells(dataCell.DataColumn, e.VisibleIndex, dataCell); } } }