Đây là Trước khi merge cell Datagrid
Đây là Sau khi mình merge cell Datagrid
Code của merge cell Datagrid của hình trên. Bạn nào bổ xung cho mình để có được hiển thị như hình bên dưới với cảm ơn rẩt nhiều

protected void grdEmployee_PreRender(object sender, System.EventArgs e)
{
if(chkChangetoNormal.Checked)
{
GridDecorator.MergeRows(grdEmployee);
}
}
//
public class GridDecorator
{
public static void MergeRows(DataGrid gridView)
{
for (int rowIndex = gridView.Items.Count - 2; rowIndex >= 0; rowIndex--)
{
DataGridItem row = gridView.Items[rowIndex];
DataGridItem previousRow = gridView.Items[rowIndex + 1];

for (int i = 0; i < row.Cells.Count; i++)
{
if (row.Cells[i].Text == previousRow.Cells[i].Text && row.Cells[i].Text!=null)
{
row.Cells[i].RowSpan = previousRow.Cells[i].RowSpan < 2 ? 2 :
previousRow.Cells[i].RowSpan + 1;
previousRow.Cells[i].Visible = false;
}

}
}
}
}
Nhưng mình muốn Như thế này ai biết giúp mình với