slimshady Posted July 13, 2006 Posted July 13, 2006 Is it possible to show extra/new columns in a gridview after user has pressed Edit? Lets say that when user goes to a page the GridView there shows two columns, one for first name and one for last name. When user clicks Edit he then can edit first name, last name AND phone number. If I set the TemplateField to "Visible = False" then there is no way to set Visible to True in the code behind since I cannot give the TemplateField an ID!? And if I set the Textbox to "Visible = False" then it shows a column anyway (before I press Edit). Of course it is empty but still it shows an empty column which I don't want! Anyone know how to do this?? Quote
APaule Posted July 19, 2006 Posted July 19, 2006 If I set the TemplateField to "Visible = False" then there is no way to set Visible to True in the code behind since I cannot give the TemplateField an ID!? You don't need the ID; take the columnindex and change the column visibility instead . This is done in the PreRender event of the GridView. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.