Home - Forums-.NET - FlyTreeView (ASP.NET) - Reset treeview selected node

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

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

Reset treeview selected node
Link Posted: 15-Jun-2009 02:10
I have an application where I have a gridview with a column containing a textbox and a linkbutton.  When the linkbutton is clicked a panel is displayed that contains a flytreeview.  The user navigates the tree to select an activity.  When a child node activities is clicked the panel closes and the node activity is added to the textbox on the gridview on the row where the linkbutton was selected.

I am using a client side routine for the node selection:
function treeview_OnSelectedNodeChanged(treeview, oldNode, newNode)

If a user now selects the linkbutton on a different row, the panel with the treeview is displayed again.  If the user selects the same activity the OnSelectedNodeChange function is not executed because there is no node change.

Is there a way I can reset the selected node to null in the treeview after a node is selected in the OnSelectedNodeChange or in the javascript code that display the treeview in the panel?

Thanks for your help.
Link Posted: 17-Jun-2009 07:34
To clear selection, you can call
yourtreeview.getSelectedNode().deselect();

See docs:
http://www.9rays.net/asp.net_2/treeview/miscpages/doc/ClientObjects.aspx