日期:2014-05-18 浏览次数:20509 次
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if(e.Row.RowType==DataControlRowType.DataRow) { if (e.Row.Cells[4].Text.Trim() == "0") { e.Row.Cells[4].Text = "<font color=red>隐藏</font>"; } else { e.Row.Cells[4].Text = "公开"; } if (e.Row.Cells[5].Text.Trim() == "0") { e.Row.Cells[5].Text = "<font color=red>新留言</font>"; } else { e.Row.Cells[5].Text = "已回复"; } } }
------解决方案--------------------
可以判断审核状态
if (审核状态通过)
{
全部显示
}
if (审核状态没通过)
{
this.WaterGridView1.Columns[0].Visible = fasle;
this.WaterGridView1.Columns[1].Visible = fasle;
}
隐藏对应的gridview列