TreeView populate on demand and mutations after expanding

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am using a TreeView in an ASP.NET application where I have my nodes update
on demand. When I expand a node that has no children and then add a child in
my datasource and expand the node again the child node correctly displays. If
I add a second one after expanding it will not show up however. It seems like
there is some kind of cache in the way or something like that.

Is there any way to force a node to repopulate?
 
Sounds like it might be generating a postback. If so, you'll need to use some
method (such as Session or Cache) to store whatever you've added and
reconstitute it after a postback. In Page_Load ,

if(IsPostBack)
{
restoreMyTreeviewStuff();
}

Peter
 
Unfortunaltely it does not generate a postback anymore once a node has been
expanded once. It just populates it with values it has cached client side.
Basically I need a node to do a postback everytime a node is expanded, not
just once, to cater for data changes.
 
Back
Top