Я добавляю 1 новую строку для каждой строки в GridView, а затем обновляю все записи, но он обновляет только 1/2 записи GridView? Кто-нибудь может мне помочь?
Это мой код:
1, Добавить новую строку для или каждой строки в GridView
protected void gvUsersL_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
GridViewRow g = new GridViewRow(-1, -1, DataControlRowType.DataRow, DataControlRowState.Normal);
//creating table Cells
TableCell tCell = new TableCell();
tCell.Text = table;
//Add Cells
g.Cells.Add(tCell);
tCell.ColumnSpan = e.Row.Cells.Count;
//Set Color for Empty Cell
g.CssClass = "bgi_1";
Table tbl = e.Row.Parent as Table;
//add rows
tbl.Rows.Add(g);
}
}
2, затем обновление:
for (int i = 0; i < gvUsersL.Rows.Count; i++)
{
//update here
}
Может ли какое-нибудь тело помочь мне? Благодарю.