Home - Forums-.NET - FlyTreeView (ASP.NET) - recurse checbox status on server code

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

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

recurse checbox status on server code
Link Posted: 08-Nov-2007 02:06
hi,

i'm using the javascript code from 9rays to handle the checkboxes status on the treeview when a user clicks them
But how to handle this behaviour on server code when i change the checked property of a checkbox ?
is there a built in way ? or i need to loop and implement my own code to handle this behaviour?

thx in advance
Link Posted: 08-Nov-2007 03:26
Is FlyTreeView.GetCheckedNodes() what you need?
Link Posted: 08-Nov-2007 03:35
no
i need the same implementation as in javascript but this time in server code, cause if you set the checked property of a parent node to false all the children will still have their states unchanged.
anyway i think it will be good to see as a gridview property too, if possible.

thx
Link Posted: 08-Nov-2007 04:03
So you need to recursively check child nodes?

So all you need is something like this:

public void CheckNodeRecursive(FlyTreeNode node)
{
    node.IsChecked = true;
    foreach(FlyTreeNode child in node.ChildNodes)
    {
         CheckNodeRecursive(child);
    }
}
Link Posted: 08-Nov-2007 04:26
not exactly as you need to check parent nodes also
i need to implement same behaviour as javascript it's easy to do but it's better to have it built in i think

thx
Link Posted: 08-Nov-2007 04:42
Unfortunately not built in.
So a custom code required