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

Subclassing RadTreeViewItem

1 Answer 42 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Owen
Top achievements
Rank 1
Owen asked on 20 Jul 2009, 04:23 PM
    public class Subclass : RadTreeViewItem 
    { 
    } 
<telerik:RadTreeView> 
        <local:Subclass Header="Group -1"/> 
</telerik:RadTreeView> 
Everything compiles, runs, I just see no Item in the TreeView...I shouldn't have to override the metadata for the DefaultStyleKey should I; it should just inherit by default. 

1 Answer, 1 is accepted

Sort by
0
Bobi
Telerik team
answered on 21 Jul 2009, 07:51 AM
Hello Owen,

Please find attached a sample project that shows how to create a custom item for RadTreeView.
All you need to do is just:

1. Add references to Telerik.Windows.Controls.dll and Telerik.Windows.Controls.Navigation.dll

2.Add some class for the custom item like:

    class CustomtreeViewItem  :RadTreeViewItem
    { ...}

3.Include the newly created class name space :

xmlns:local="clr-namespace:TreeView_Test"

4. Add some CustomTreeviewItem in your RadTreeView:

      <controls:RadTreeView>
            <local:CustomtreeViewItem Header="test" />
        </controls:RadTreeView>

I hope that this will help you.

Best wishes,
Boryana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
TreeView
Asked by
Owen
Top achievements
Rank 1
Answers by
Bobi
Telerik team
Share this question
or