I am having the data in datatable with the below format that i am trying to bind to the gridview (format -1)
Id col1 col2
20 a ac-1
20 a ac-2
20 a ac-3
20 a ac-4
21 a ac-1
21 a ac-2
21 a ac-3
21 a ac-4
after had databound i am getting gridview in below format (format- 2)
Id col1 col2
20 a ac-1
ac-2
ac-3
ac-4
21 ac-1
ac-2
ac-3
ac-4
but I am looking for the below format of the data to be represent in gridview (Format-3)
Id col1 col2
20 a ac-1
ac-2
ac-3
ac-4
21 a ac-1
ac-2
ac-3
ac-4
and the below code is for Ondatabound event in grdiview
for (int i = gvConversionGrid.Rows.Count - 1; i > 0; i--)
{
GridViewRow row = gvConversionGrid.Rows[i];
GridViewRow previousRow = gvConversionGrid.Rows[i - 1];
for (int j = 0; j < row.Cells.Count; j++)
{
if (row.Cells[j].Text == previousRow.Cells[j].Text)
{
if (previousRow.Cells[j].RowSpan == 0)
{
if (row.Cells[j].RowSpan == 0)
{
previousRow.Cells[j].RowSpan += 2;
}
else
{
previousRow.Cells[j].RowSpan = row.Cells[j].RowSpan + 1;
}
row.Cells[j].Visible = false;
}
}
}
}
Is there any way to manipulate the gridview and to bring the format for the gridview data like as in format-3..
Would any one please help on this one query that would be very grateful to me .. Many thanks in advance
Update : I am looking for the below format image