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

RadMenuItem issue with theming

2 Answers 60 Views
Documentation and Tutorials
This is a migrated thread and some comments may be shown as answers.
Andrey
Top achievements
Rank 1
Andrey asked on 03 Mar 2015, 08:29 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Ivan Danchev
Telerik team
answered on 04 Mar 2015, 04:40 PM
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.

 
0
Andrey
Top achievements
Rank 1
answered on 04 Mar 2015, 06:09 PM
This is perfect, thank you !!
Tags
Documentation and Tutorials
Asked by
Andrey
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Andrey
Top achievements
Rank 1
Share this question
or