Question

Platform: WPF, .NET 4, Visual Studio 2010
XAML code is as below:

<telerik:RadTreeView x:Name="mytree"
IsOptionElementsEnabled="True"
IsLineEnabled="True"
HorizontalAlignment="Left" AllowDrop="True">
<telerik:RadTreeViewItem Header="Root of the Tree" x:Name="myroot" AllowDrop="True">

I intend to add a node in the code behind like the following way:
RadTreeViewItem treeviewitem = new RadTreeViewItem();
treeviewitem.Header = "some text here";
myroot.Add(treeviewitem);

However it sseems like there is no Add method in the radtreeviewitem class. Intellisense does not give that option when I try to do it. How should I proceed?

Was it helpful?

Solution

Use "myRoot.Items.Add(treeviewitem)" instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top