Geeks With Blogs
Fórmulas e Cenas Object Reference Not Set to an Instance of an Object
Hello,

If you are reading this you probably have already realized that it is not possible to hide a column that was auto-generated using myGridView.Columns[index].Visible=false;
To achieve this you must:
1 - set the OnRowCreated to execute a function, something like OnRowCreated="gridRowCreated"
2 - Create your function as such:

protected void gridRowCreated(object sender, GridViewRowEventArgs e)
        {
            e.Row.Cells[yourIndexHere].Visible = false;
        }

Hope this helps ;) Posted on Thursday, October 29, 2009 9:23 AM Asp.Net , C# | Back to top


Comments on this post: Hidding auto generated columns in GridView

# re: Hidding auto generated columns in GridView
Requesting Gravatar...
Thanks it works as required, i am able hide my autogenerated columns
Left by Jinesh on Apr 11, 2012 3:33 AM

Your comment:
 (will show your gravatar)


Copyright © Sglima | Powered by: GeeksWithBlogs.net