There are a lot of good examples. For example:
-
How to merge cells with equal values in a GridView[
^]
-
Rows and Columns Merging in ASP.NET GridView Control[
^]
and so on...
ADDITION:
merge just 1st column (based on the code in first article)
public static void MergeRows(GridView gridView)
{
for (int rowIndex = gridView.Rows.Count - 2; rowIndex >= 0; rowIndex--)
{
GridViewRow row = gridView.Rows[rowIndex];
GridViewRow previousRow = gridView.Rows[rowIndex + 1];
if (row.Cells[0].Text == previousRow.Cells[0].Text)
{
row.Cells[0].RowSpan = previousRow.Cells[0].RowSpan < 2 ? 2 :
previousRow.Cells[0].RowSpan + 1;
previousRow.Cells[0].Visible = false;
}
}
}