62,053
社区成员
发帖
与我相关
我的任务
分享
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.Cells[0].Text = "用户名";
}
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].Text = ((DataTable)this.GridView1.DataSource).Rows[e.Row.RowIndex]["UserName"].ToString();
}
}