Context menu has no theme

5 posts, 0 answers
  1. Jay
    Jay avatar
    8 posts
    Member since:
    Aug 2012

    Posted 22 Feb 2013 Link to this post

    I created a RadContextMenu and added it to my RadGridView, but the menu appears to have no theme. It doesn't look anything like the default menu and the ThemeName is blank.

    I tried this but the the RootElement doesn't seem to have a ForceApplyTheme() method anymore.
  2. Anton
    Admin
    Anton avatar
    167 posts

    Posted 26 Feb 2013 Link to this post

    Hi Jay,

    Thank you for writing.

    The provided information is not enough for me to determine what causes this behavior. Could you please provide me more information about the following questions:
    1. Is it your menu custom that inherits RadContextMenu?
    2. What is the theme that you are using?
    3. What is the version of our suite that you are using?

    I am looking forward to your reply.

    Kind regards,
    Anton
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jay
    Jay avatar
    8 posts
    Member since:
    Aug 2012

    Posted 26 Feb 2013 Link to this post

    Thanks for your response.

    1. My menu item inherits RadMenuItem and adds a couple properties. I add my inherited menu items to a RadContextMenu.
    2. I'm using what ever the default theme is. I haven't changed it.
    3. When I right click a Tekerik assembly in References and select Properties, it says Version = 2013.1.220.20, Runtime Version = v2.0.50727. I am using a trial version.

    Thanks,
    Jay

  5. Anton
    Admin
    Anton avatar
    167 posts

    Posted 27 Feb 2013 Link to this post

    Hello Jay,

    Thank you for writing.

    When you are using custom elements you should override the ThemeEffectiveType property to return the type of base element - in your case RadMenuItem. For example:
    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(RadMenuItem);
        }
    }

    This will allow your custom element to be recognized by our themes like RadMenuItem and the style for it to be applied to your custom element.

    I hope this helps. Should you have any other questions, I will be glad to assist you.

    All the best,
    Anton
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
  6. Jay
    Jay avatar
    8 posts
    Member since:
    Aug 2012

    Posted 27 Feb 2013 Link to this post

    Thanks Anton. That worked great.
Back to Top
UI for WinForms is Visual Studio 2017 Ready