我想把gridview某一列隐藏,设置Visiable=false又取不到该列的值,请问怎么设置宽度为0怎么设置

解决方案 »

  1.   

    用css隐藏就没有问题了 宽度为0这个思路是不对的
      

  2.   

    gridview1.colums[0].visible = false;
      

  3.   

    Visible protected void grd_RowDataBound(object sender, GridViewRowEventArgs e) 

        if (e.Row.RowType == DataControlRowType.DataRow) 
        { 
            e.Row.Cells[0].Visible = false; 
        } 
    }
      

  4.   

    void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow || 
                e.Row.RowType == DataControlRowType.Header)
            {
                e.Row.Cells[3].Visible = false; //如果想使第1列不可见,则将它的可见性设为false
            } 
            
        }