Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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??

Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...