Home - Forums-.NET - FlyTreeView (ASP.NET) - refreshing flytreeview

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

refreshing flytreeview
Link Posted: 09-Nov-2005 21:59
Hi !
a question about the flytreeview : is it possible to force its refresh ?

I'm explaining : I've created a usercontrol which contains a flytreeview in order to make easy-to-use populating functions for my developpers. With this usercontrol , it's possible to add root nodes/child nodes and delete nodes.
The flytreeview is populated with values stored in dataset (from a database).
The user can delete nodes. The deletion is sent to database, and the page is postbacked. Then, the treeview is repopulated (and i did not forget to call the Nodes.Clear() function), and when i'm debugging the app, i can see that the deleted node is not anymore in the treeview. But.... the node is still present on the page, even if no action is possible on this node. I have to force one more time the refresh of my page.
Precision : when i dynamically add a node to the treeview, the same populating function is called, and the treeview is well populated.

Any Idea ?
Thanks !
Herv?
Link Posted: 10-Nov-2005 20:59
Herv?,

I'm sorry but I didn't undestand your words:
the node is still present on the page, even if no action is possible on this node


What do you mean "the node is on the page". The FlyTreeView node is not a control.

Could you please make me clear with this situation so I can help you.
Link Posted: 27-Nov-2005 22:17
Sure! i'm sorry.
here is something that looks like to my treeview :
   + RootNode
        - SubNode1 x
        - SubNode2 x
        - SubNode3 x

When the user clicks on 'x' , a javascript function is called. This javascript function gets an id stored in selected node attributes and then postback the page containing the treeview. When the page is loading, the id is used to delete the corresponding data in database, and then the treeview is rebuilt. Of course, i call the nodes.clear function. When i use the step-to-step debugger , i can see that the treeview is correctly populated, without the deleted node. But, when the page is rendered the treeview is exactly the same as before the postback, and no action is possible on the treeview. the only way to make it work is to reload the page by pressing F5 on my browser...
is it clear ?

Thanks a lot
Herv?
Link Posted: 28-Nov-2005 23:45
Herv?,

Do you have the deleted node when you're debuggin the OnPretender method on the page? I ask you because the treeview renders only nodes present in its Nodes collection and nothing else (or NodeSrc if defined).
Link Posted: 29-Nov-2005 23:24
Thanks for our answer.
I've watched in the prerender methods (Page.PreRender and FlyTreeView.PreRender), and it seems that the deleted node does not appear in the node collection. But the deleted node is still visible in the page, and no action is possible on the treeview.
Is it because my treeview is stored in a usercontrol ?
Link Posted: 30-Nov-2005 02:43
Thanks for our answer.
I've watched in the prerender methods (Page.PreRender and FlyTreeView.PreRender), and it seems that the deleted node does not appear in the node collection. But the deleted node is still visible in the page, and no action is possible on the treeview.
Is it because my treeview is stored in a usercontrol ?
Link Posted: 30-Nov-2005 05:27
Additional information :
when the treeview is repopulated after a deletion, using the debugger shows that the node collection is up-to-date according to the database. And when the page is rendered, if i try to see page source via IE, i can see that the deleted node is present.

Maybe it could help.
Herv?
Link Posted: 01-Dec-2005 21:09
Possibly this is a cache problem.
You may try to put something like this into your ASCX control source:



And see if there's any difference in the output before and after deleting node.
Link Posted: 07-Dec-2005 04:13
No deference...
Link Posted: 07-Dec-2005 22:20
No difference or "no deference" ? :)
If no difference then this is a cache problem.