Home - Forums-.NET - FlyTreeView (ASP.NET) - Templates with Databound tree nodes

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

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

Templates with Databound tree nodes
Link Posted: 02-Mar-2006 10:12
Hi,

I'm having a problem getting a databound tree to render using templates. Using the sample Demo_ServerTemplates page, I removed the static nodes from the source (i.e. removed the  element and children) and added data source binding in the treeview's Load event:

protected void flyTreeView_Load(object sender, EventArgs e)
{
    // init my data source
    MyHierarchicalDataSource myDS = new MyHierarchicalDataSource();
    ...

    // bind
    flyTreeView.DataSource = myDS;
    flyTreeView.DataBind();

    // set node type on root nodes
    foreach (FlyTreeNode node in flyTreeView.Nodes)
    {
        node.NodeTypeID = "name";
    }
}


(using version 4.0.102.0)

The binding works great and the tree structure is as expected. The rendered root level nodes, however, are the same as their children: setting the NodeTypeID this way does not appear to have any effect.

If I populate the tree programatically (i.e. flyTreeView.Nodes.Add(node)) in this event and set the NodeTypeID property it works, so what is difference with bound nodes? Is there a way to make this work?

Thanks,

Warren
Link Posted: 06-Mar-2006 13:02
The latest build (111) contains a fix for the issue.