Reputation: 6117
dynamic grid view loses binding when post back occurs ?
I have a dynamic grid View with template fields and bound fields as columns
for the first page load all binding looks fine.values are populated in all columns
when I trigger an event such as selected index changed in Drop downlist present in the column header(inside template field ) the binding are lost and the event is never catched.
how to retain controls when post back occurs and how to resolve this problem ?
Upvotes: 0
Views: 1665
Reputation: 4654
I think you should populate the grid in the Page_Load (which is fired on each update) and set this after populating: <gridname>.Databind();
Upvotes: 0
Reputation: 17951
Everytime there is a postback you will have to rebind your grid. Hope you are doing this?
Upvotes: 1