改变已经绑定的数据Gridview
protected void GvSelect_RowDataBound(object sender, GridViewRowEventArgs e)
{ if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowState == DataControlRowState.Normal e.Row.RowState DataControlRowState.Alternate)
{
Label test = e.Row.FindControl("Label1") as Label;
if (test.Text.Trim() == "1")
{
test.Text = "已阅读";
}
else {
test.Text = "未阅读";
}
}
} // test.Text = view["status"].ToString();
}
|