Home - Forums-.NET - FlyTreeView (ASP.NET) - Disable Collapsing a Node

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

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

Disable Collapsing a Node
Link Posted: 22-Sep-2005 05:42
Hello,

I would like to disable the ability to collapse the root node of my tree.
I am not seeing any obvious way to do this.

Is this possible and ,if so, how is it done?

thanks.
Link Posted: 22-Sep-2005 13:10
This does not look to be simple thing to do with this treeview.
But actually there's a kind of trick.
There're some lines in node.htc file:
function o112(){
if (o75() || o96() == 0) return;
if (o46) {
TreeView.queueNodeEvent(element, 'ONBEFORECOLLAPSE');


This is actually Collapse function of node and you may try to check the Key value in order to prevent node from collapsing (o42 is a Key property as you may refer from the header of node.htc):

function o112(){
if (o42 == "yourRootNodeKey") return;
if (o75() || o96() == 0) return;
if (o46) {
TreeView.queueNodeEvent(element, 'ONBEFORECOLLAPSE');


P.S. This looks to be much easier if you have source code of the control.