我想更新我的gridview,执行以下操作。但是,gridview中的值不会发生变化。我不确定我在做什么。
protected void grvAgents_OnRowDataBound (object sender, GridViewRowEventArgs e)
{
if (hours)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
rowView["TotalLoginTime"] = ConvertToHours (rowView["TotalLoginTime"].ToString (), 2);
rowView["TotalActive"] = ConvertToHours(rowView["TotalActive"].ToString(), 2);
rowView["TotalWTime"] = ConvertToHours(rowView["TotalWTime"].ToString(), 2);
rowView["TotalIdle"] = ConvertToHours(rowView["TotalIdle"].ToString(), 2);
rowView.EndEdit();
rowView.Row.AcceptChanges();
}
}
}