I have a gridview with several boundfields and 1 template field that contains a link button. When I click on this link button I want to change one of my bound fields from text to a link button on the affected row. This part works just fine. I click the existing link button and the text in the appropriate field is replaced with a link button. But when I click on the new link button it just disappears. I have been researching this all morning and I believe below are the pertinent facts:
- I am using the gridview OnRowCommand to capture the link button click and take the appropriate action based on the CommandName
- I am using the gridview OnRowDataBound to create and add the new link button
- I am binding the gridview in !IsPostBack
Based off some other posts I read I think that binding the gridview in !IsPostBack is causing the new linkbutton to disappear. How can I fix this? Do I need to add the new linkbutton somewhere other than OnRowDataBound? Do I need to bind the grid somewhere other than !IsPostBack? Am I going about this completely the wrong way?
I am happy to post any of my code, I just was not sure what would be most helpful. I apologize if this has been answered elsewhere. I have found lots of posts with similar situations, but none of them had an answer that I could use.
View Complete Post