asp.net 根据权限隐藏GridView最后两列 防止增删改查
string cx = Session["cx"] as string;
if (cx == "学生")
{
DataGrid1.Columns[DataGrid1.Columns.Count - 1].Visible = false;
DataGrid1.Columns[DataGrid1.Columns.Count - 2].Visible = false;
}