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

enable and disable radmenuitem

2 Answers 304 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Sigma
Top achievements
Rank 1
Sigma asked on 05 Mar 2013, 08:02 AM
Hi,

How to enable and disable the child item of the RadMenu depending on the parent item?

Thanks,
Sigma

2 Answers, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 05 Mar 2013, 09:04 AM
Hello Sigma,

I would suggest that you refer to the following help articles where you can find more information on client-side API of the RadMenu control - RadMenuItem object. By using any of the client-side events of the RadMenu you can get the menu item object and set it as enabled/ disabled with the set_enabled(true)/set_enabled(false) property.

Greetings,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Shinu
Top achievements
Rank 2
answered on 05 Mar 2013, 11:18 AM
Hello Sigma,

Please have a look into the following client side code in which I am disabling a child item of the RadMenu based on its parent.

JavaScript:
<script type="text/javascript">
    function pageLoad() {
        var menu = $find("<%= RadMenu1.ClientID %>");
        var menuItem = menu.findItemByText("Format Document");
        if (menuItem.get_parent()._text == "Advanced") {
            menuItem.disable();
        }
    }
</script>

Thanks,
Shinu.
Tags
Menu
Asked by
Sigma
Top achievements
Rank 1
Answers by
Kate
Telerik team
Shinu
Top achievements
Rank 2
Share this question
or