开发者

ASP.NET GridView - Editing Dynamic Template Columns

开发者 https://www.devze.com 2022-12-12 17:23 出处:网络
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 ini

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 initi开发者_如何学Cal 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!


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消