tags:

views:

12

answers:

2

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 ?

+1  A: 

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

ajay_whiz
i have called my grid creation in page load only is there any other options to retain the grid .
Arunachalam
@Arunachalam store it in a persistent object cache/session/viewstate etc.
ajay_whiz
A: 

I think you should populate the grid in the Page_Load (which is fired on each update) and set this after populating: <gridname>.Databind();

Sidharth Panwar