Unplanned
Last Updated: 30 Mar 2016 13:33 by ADMIN
ADMIN
George
Created on: 01 May 2014 13:12
Category: TreeView
Type: Bug Report
3
FIX. RadTreeView - AddNodeByPath does not create parent nodes if they do not exist
To reproduce:

Use the following code on an empty RadTreeView: 

this.TreeView.AddNodeByPath("General\\Billing\\February\\Report.txt");

You will see that the Report.txt node will be added to the Root node

Workaround:

Use the following method:

private RadTreeNodeCollection AddNode(string path)
{
    if (path == String.Empty)
        return this.TreeView.Nodes;


    string node = Path.GetFileName(path);
    RadTreeNodeCollection parent = AddNode(Path.GetDirectoryName(path));


    if (parent.Contains(node))
        return parent[node].Nodes;
    else
        return parent.Add(node).Nodes;
}

0 comments