enable and disable radmenuitem

3 posts, 0 answers
  1. Sigma
    Sigma avatar
    87 posts
    Member since:
    Apr 2012

    Posted 05 Mar 2013 Link to this post

    Hi,

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

    Thanks,
    Sigma
  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 05 Mar 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Mar 2013 Link to this post

    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.
Back to Top