Monday, May 05, 2025

Breaking News
>> Securing and encrypt View State and Cookies values  >> Page has one or more controls that do not correspond with   >> “The Controls collection cannot be modified because the control contains code blocks”  >> How to fix "Validation(): Element 'xxxx' is not supported  >> How to create a new session in ASP.NET programmatically  >> MySQL Database Backup using mysqldump command    

Editors Picks

Friday, December 9, 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 in GridView1.Rows)
            {
                gvr.Cells[0].Visible = false;
            }
        }

No comments :

Post a Comment

Contact Us

Name

Email *

Message *