How to maintain state of a TreeView control

  • Thread starter Thread starter keithb
  • Start date Start date
K

keithb

I have a TreeView control with EnableViewState = True; however, the TreeView
does not maintain its previous state on postback. Is there something else
that needs to be set up?

Thanks,

Keith
 
Are you repopulating or rebinding (however you handle it) on every
post? I.e. in the form load event, ?

if so, make sure to check for IsPostBack (in form load) and only bind
the Tv when IsPostBack=false.

-Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top