RadMenuItem issue with theming

3 posts, 1 answers
  1. Andrey
    Andrey avatar
    5 posts
    Member since:
    Mar 2015

    Posted 03 Mar 2015 Link to this post

    Hey guys, I am new to the forum and I have been looking for a quick suggestion. My issue is that I have a Radmenuitem, however I want to disable it because I don't need it to change onclick nor on hover, but I DO need it to change with the theming, and when it is disabled it does not change. Do I need to modify the css file directly or is there a workaround ? thanks in advance. I am also new to the UI...
  2. Answer
    Ivan Danchev
    Admin
    Ivan Danchev avatar
    830 posts

    Posted 04 Mar 2015 Link to this post

    Hello,


    Using the correct selector you can apply the same style to a disabled RadMenuItem that you are applying to enabled ones. For instance, if you have changed the text color of the other items to "red" and you want that change to apply to a disabled item as well you can use the following CSS rule:
    html .RadMenu .rmGroup .rmDisabled {
        color: red;
    }
     
    There is another approach you can use. You can subscribe to the OnClientItemOpening client-side event and cancel the clicked/hovered item's default behavior. This won't disable the item but it would react almost as a disabled item does, except for the styles that would still apply to it: 
    <telerik:RadMenu ID="RadMenu1" runat="server" OnClientItemOpening="ItemOpening">

    function ItemOpening(menu, args) {
        var item = args.get_item().get_text();
        if (item === "Child Item 1.1") {
            args.set_cancel(true);
        }
    }

    In the example above we specify the particular item ("Child Item 1.1") we want to cancel the default behavior of.

    Regards,
    Ivan Danchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andrey
    Andrey avatar
    5 posts
    Member since:
    Mar 2015

    Posted 04 Mar 2015 in reply to Ivan Danchev Link to this post

    This is perfect, thank you !!
Back to Top