Arunachalam
Arunachalam

Reputation: 6117

dynamic grid view loses binding when post back occurs?

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

Answers (2)

Sidharth Panwar
Sidharth Panwar

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

ajay_whiz
ajay_whiz

Reputation: 17951

Everytime there is a postback you will have to rebind your grid. Hope you are doing this?

Upvotes: 1

Related Questions