RadTreeView CustomControl loosing default Theme?

2 posts, 0 answers
  1. Wolfgang
    Wolfgang avatar
    2 posts
    Member since:
    Aug 2011

    Posted 18 Nov 2011 Link to this post

    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
  2. Ivan Petrov
    Admin
    Ivan Petrov avatar
    701 posts

    Posted 21 Nov 2011 Link to this post

    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.

  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top