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

Custom RadTreeNode

1 Answer 144 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
joseph
Top achievements
Rank 1
joseph asked on 06 Jun 2013, 06:20 PM
I have custom TreeNodes that inherit from RadTreeNode.  When I try to select a node via code the custom treenode will not highlight.  I've tried all the examples I could find.  I saw the post about overriding the ThemeClassName for a treeview, but there is no such property for the radtreenode.  help please

1 Answer, 1 is accepted

Sort by
0
Anton
Telerik team
answered on 12 Jun 2013, 06:48 AM
Hello Joseph,

Thank you for writing.

When you are inheriting some of our controls and you want our theming mechanism to apply the theme for it you should set it ThemeClassName property. Consider the following example :
this.ThemeClassName = typeof(SomeInheritedControl).FullName;

However, in your case you are inheriting element not control, so you should not set ThemeClassName property but you should override the ThemeEffectiveType property in your custom element. This will point our theming mechanism how to style your custom element.

Add the following code into your custom tree node:
protected override Type ThemeEffectiveType
{
    get
    {
        return typeof(RadTreeNode);
    }
}

I hope this helps.

Regards,
Anton
Telerik
RadChart for WinForms is obsolete. Now what?
Tags
Treeview
Asked by
joseph
Top achievements
Rank 1
Answers by
Anton
Telerik team
Share this question
or