This is a migrated thread and some comments may be shown as answers.

Path Separator property wanted

2 Answers 62 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Andreas Cieslik
Top achievements
Rank 2
Andreas Cieslik asked on 30 Jun 2010, 04:22 PM
Hello,

I am really really missing the PathSeparator property in the RadTreeView control like there is for WPF or Silverlight (e.g. http://www.telerik.com/help/wpf/radtreeview-feautres-treeviewitem-expanding-and-collapsing-items.html)

I really need to change the default path separator "/" to another character, because some text in the Node.Text property can have a title like "Trash/Waste". When retrieving the full path via the FullPath property I will get a wrong path.

Is there a way around this?

Thanks for any help or suggestions!

Andreas

2 Answers, 1 is accepted

Sort by
0
Andreas Cieslik
Top achievements
Rank 2
answered on 01 Jul 2010, 09:58 AM
I found the answer myself:

After using the Reflector tool, I found out that the property FullPath of a RadTreeNode calls the method GetFullPath("/").
So to use your own separator just call RadTreeNode.GetFullPath("SEP").

Suggestion for future release: new property "PathSeparator" which may have the value "/" as default, and change the implementation of the property "FullPath" from
 public string FullPath
{
    get
    {
        return this.GetFullPath("/");
    }
}

to

public string FullPath
{
    get
    {
        return this.GetFullPath(PathSeparator);
    }
}

Best Regards,
Andreas
0
Veronica
Telerik team
answered on 01 Jul 2010, 03:13 PM
Hello Andreas Cieslik,

We are glad that you have found the solution on your own.

At this moment we don't have such method ExpandItemByPath. It it is very easy to set different delimiters for the path via the GetFullPath function which will return the full path of the node delimited by the specified character.

In the code bellow you can see it is done in one row:
 
protected void RadTreeView1_NodeClick(object sender, RadTreeNodeEventArgs e)
    {
        MessageBox.Show(e.Node.GetFullPath(">>"));
    }

So it is not necessary to add PathSeparator property. Anyway thank you for the suggestion.

Regards,
Veronica Milcheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TreeView
Asked by
Andreas Cieslik
Top achievements
Rank 2
Answers by
Andreas Cieslik
Top achievements
Rank 2
Veronica
Telerik team
Share this question
or