Thursday, 8 December 2011

How to hide Gridview column programmatically?


        GridView1.DataBind();
        if(GridView1.Columns.Count > 0)
            GridView1.Columns[0].Visible = false;
        else
        {
            GridView1.HeaderRow.Cells[0].Visible = false;
            foreach(GridViewRow gvr inGridView1.Rows)
            {
                gvr.Cells[0].Visible = false;
            }
        }

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Powered by Blogger