gridview Problem
-
Hi, I have a gridview where there is two static columns which are template columns and few dynamic columns. there is a button in that page. On clicking on that button the dynamic column are dynamically creating. Each time I am removing the old dynamic columns and recreate the new columns according to some selection criteria. But my problem is on the third time click on the button the static template columns are getting removed from the gridview.
Thanks & Regards Mishra
-
Hi, I have a gridview where there is two static columns which are template columns and few dynamic columns. there is a button in that page. On clicking on that button the dynamic column are dynamically creating. Each time I am removing the old dynamic columns and recreate the new columns according to some selection criteria. But my problem is on the third time click on the button the static template columns are getting removed from the gridview.
Thanks & Regards Mishra
Ballita wrote:
are getting removed from the gridview.
Looks like viewstate issue. ASP.NET won't maintain viewstate for dynamically created controls/columns. So you need to reconsider the event where you are creating dynamic columns. Dynamic columns created on page_load/button click events won't keep viewstate. Try to do this in
Init()
method.