Gridview中显示的值根据数据库中带出的值作更改

前台页面对Gridview增加事件 OnRowDataBound="GridView1_RowDataBound"
protected
void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { if (e.Row.Cells[4].Text.Trim() == " ") e.Row.Cells[4].Text = "未签核"; else if (e.Row.Cells[4].Text.Trim() == "AP") { e.Row.Cells[4].Text = "被否决"; } else { e.Row.Cells[4].Text = "使用中"; } } }

 

posted @ 2017-01-13 11:30  水墨晨诗  阅读(165)  评论(0编辑  收藏  举报