Quote:
I have tried this below code, but this is working fine only for first column.
So, use the same logic for second, third and fourth column. For example (two columns version):
string sCol1Value = string.Empty;
string sCol2Value = string.Empty;
sCol1Value = gv.Rows[0].Cells[0].Text;
sCol2Value = gv.Rows[0].Cells[1].Text;
for (int i = 1; i < gv.Rows.Count; i++)
{
if (gv.Rows[i].Cells[0].Text == sCol1Value)
gv.Rows[i].Cells[0].Text = string.Empty;
else
sCol1Value = gv.Rows[i].Cells[0].Text;
if (gv.Rows[i].Cells[1].Text == sCol2Value)
gv.Rows[i].Cells[1].Text = string.Empty;
else
sCol2Value = gv.Rows[i].Cells[1].Text;
}
Got it?