Restore datagrid after panel visible

Hi experts,
I have a datagrid using DataSourceID. It loads on form load, but loses data when the panel it's in is made visible again.
Ideally I'd like to use a viewstate to restore the data.
I try using rebind but it doesn't do anything, and I can't use a datasource from code behind.
Any good ideas?
LVL 1
Netlink2Asked:
Who is Participating?
 
Alan WarrenConnect With a Mentor Commented:
You say you have tried?:

Panel.visible=true
datagrid.DataBind()

Are you toggling the visibility of the panel via clientscript or serverscript?

If toggleing visiblity via clientscript and If the datagrid is in an updatepanel, you could try to databind the updatepanel.
http://weblogs.asp.net/jeffreyzhao/archive/2008/04/26/refresh-the-updatepanel-using-javascript-code.aspx

Alan
0
 
Netlink2Author Commented:
I believe that would work. I'll give it a try.
0
 
Netlink2Author Commented:
It may not be ideal, but I guess using JavaScript to hide/show the panels is the only way. Thanks.
0
All Courses

From novice to tech pro — start learning today.