ASP.NET GridView - Editing Dynamic Template Columns
Posted
by user208662
on Stack Overflow
See other posts from Stack Overflow
or by user208662
Published on 2009-11-30T14:08:27Z
Indexed on
2010/04/03
0:03 UTC
Read the original article
Hit count: 529
Hello,
I have created a GridView whose columns are dynamically created based on my data source. I have implemented these columns by using the approach described here.Those columns display properly on the initial load. However, I need to implement commanding so that a user can edit / delete a row in the GridView.
At this point, I have implemented commanding as I would with a normal GridView. I have a TemplateField with an ItemTemplate that has LinkButton elements for edit and delete. The CommandName for each LinkButton is set to either Edit or Delete respectively.
Oddly, when a user clicks either the Edit or Delete link, the data in the GridView disappears. However, I have verified that I am in fact re-binding the data when one of these LinkButton elements is selected.
Can anyone provide some suggestions as to what the cause could be?
Thank you!
© Stack Overflow or respective owner