string sql = "select * from test";
rep1.DataSource = DbManager.ExecuteQuery(sql);
rep1.DataBind();
for (int i = rep1.Items.Count - 1; i > 0; i--)
{
HtmlTableCell oCell_previous = rep1.Items[i - 1].FindControl("td1") as HtmlTableCell;
HtmlTableCell oCell = rep1.Items[i].FindControl("td1") as HtmlTableCell;
oCell.RowSpan = (oCell.RowSpan == -1) ? 1 : oCell.RowSpan;
oCell_previous.RowSpan = (oCell_previous.RowSpan == -1) ? 1 : oCell_previous.RowSpan;
if (oCell.InnerText == oCell_previous.InnerText)
{
oCell.Visible = false;
oCell_previous.RowSpan += oCell.RowSpan;
}
}