R – ASP.NET GridView – Editing Dynamic Template Columns

asp.netgridviewitemplate

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!

Best Answer

Here are good examples. You can figure out postback issue.

http://quickstarts.asp.net/QuickStartV20/aspnet/

Related Topic