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

RadTreeView CustomControl loosing default Theme?

1 Answer 23 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Wolfgang
Top achievements
Rank 1
Wolfgang asked on 18 Nov 2011, 11:02 AM
Hello!

I've build a CustomControl derived from RadTreeView and overwritten the Click method from the RadTreeView.
I want to use the default Telerik - Theme like in my other RadControls
Properties:
         ThemeClassName: Telerik.WinControls.UI.*RadTreeView*,
         ThemeName: ControlDefault or mostly string empty

When i use the CustomControl i loose all the default view settings of the RadTreeView.
Selection and Mouse Over etc. displayed as white.
Functionality works as expected.
I tried to copy the Telerik.WinControls.UI.RadTreeView to the ThemeClassName property of the Control.
But this doesn't work.
How can i use the default behaviour view of the RadTreeView in my CustomControl?

Thanks and kind regards

1 Answer, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 21 Nov 2011, 04:42 PM
Hi Wolfgang,

Thank you for writing.

To make the theme work with your custom control you have to override the ThemeClassName property. In the case of the RadTreeView your code should look like the following code snippet:

public override string ThemeClassName
{
  get
  {
    return typeof(RadTreeView).FullName;
  }
}

This is the only thing you should do to make the theme work for your control.

I hope this will help. Should you have further questions, I would be glad to assist you further.
Kind regards,
Ivan Petrov
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

Tags
Treeview
Asked by
Wolfgang
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Share this question
or