i am tried to merge to grid view repited record like..
1>> Source Code
-----------------------------------------------
Code behind code >>
protected void gvAddBudgetExpence_RowDataBound(object sender, GridViewRowEventArgs e)
{
for (int rowIndex = gvAddBudgetExpence.Rows.Count - 5;
rowIndex >= 0; rowIndex--)
{
GridViewRow gvRow = gvAddBudgetExpence.Rows[rowIndex];
GridViewRow gvPreviousRow = gvAddBudgetExpence.Rows[rowIndex + 1];
for (int cellCount = 0; cellCount < gvRow.Cells.Count;
cellCount++)
{
if (gvRow.Cells[cellCount].Text ==
gvPreviousRow.Cells[cellCount].Text)
{
if (gvPreviousRow.Cells[cellCount].RowSpan < 2)
{
gvRow.Cells[cellCount].RowSpan = 2;
}
else
{
gvRow.Cells[cellCount].RowSpan =
gvPreviousRow.Cells[cellCount].RowSpan + 1;
}
gvPreviousRow.Cells[cellCount].Visible = false;
}
}
}
}
--------------------
But it is not work properly.
Please help .
Replies
Know the answer? Post it — somebody with the same question will find it here.