GridView的AutoGenerateSelectButton="True"
如何隐藏这一列,现就是"选择列":用以下事件来处理
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].Attributes.Add("style", "display:none");
}
}
出现Head部份无法隐藏
应该怎么也把Head的选择列也隐藏掉??
如何隐藏这一列,现就是"选择列":用以下事件来处理
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].Attributes.Add("style", "display:none");
}
}
出现Head部份无法隐藏
应该怎么也把Head的选择列也隐藏掉??
{
e.Row.Cells[0].Attributes.Add("style", "display:none");
}
{
e.Row.Cells[0].Attributes.Add("style", "display:none");
}
在GridView1_RowDataBound里面不行
if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.Cells[0].Attributes.Add("style", "display:none");
}
GridView1.Columns[1].Visible = false;