开发者

add radtreeview items to radtreeview root programmatically

开发者 https://www.devze.com 2023-01-17 02:29 出处:网络
Platform: WPF, .NET 4, Visual Studio 2010 XAML code is as below: <telerik:RadTreeView x:Name=\"mytree\"

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:RadT开发者_高级运维reeViewItem 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 seems 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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号