Disable Menu Item from another page when called

6 posts, 0 answers
  1. Wendy Hunt
    Wendy Hunt avatar
    50 posts
    Member since:
    Nov 2009

    Posted 24 Feb 2010 Link to this post

    Hi -

    I have a button, that when clicked... I want it to disable the menu until an action is taken, then have the menu operational (enabled) again by clicking a different button.  The purpose of my actions is to not let the user navigate off the page until they have finished editing and then have saved their work. 

    I have been going through the postings and haven't found anything that works (I've tried many examples...Visible...EnableSelection...Enabled...etc). 

    My menu is located on the Master page, and my calling code is located on the SOI page.

    Here is the code I have so far...
          private void EnableNavigation(bool enabled)  
          {  
            RadMenu menu = (RadMenu)(Master.FindControl("RadMenu1"));  
            menu.Enabled = enabled;  
          } 

    This is how I call it from my Edit button click method... 
    EnableNavigation(false);

    Any other suggestions?  Should I be going about this in a different way?

    wen
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 25 Feb 2010 Link to this post

    Hello Wendy,

    This approach seems correct.

    Greetings,
    Yana
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Wendy Hunt
    Wendy Hunt avatar
    50 posts
    Member since:
    Nov 2009

    Posted 25 Feb 2010 Link to this post

    Do you think I should put in a support ticket, if it should be working but isn't?

    wen
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 25 Feb 2010 Link to this post

    Hi Wendy,

    I'm sorry I didn't understand that this doesn't work.
    Could you please prepare a simple page demonstrating the issue and send it in the support ticket so we to be able to test it? Thanks in advance.

    Kind regards,
    Yana
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Liz
    Liz avatar
    4 posts
    Member since:
    Mar 2013

    Posted 02 May 2013 Link to this post

    I am experiencing a very similar issue. I originally on initialization of the RadMenu set a menu item to be Enabled = false;

    RadMenu menu = new RadMenu();
    menu.Value = "Menu";
    RadMenuItem toggledMenuItem = new RadMenuItem("Save File");
    toggledMenuItem.Value = "ToggledMenuItem";
    toggledMenuItem.Enabled = false;

    I can successfully change the value of Enabled to be true when a different variable is populated using the following code: 

    RadMenu foundMenu = FindControl("Menu") as RadMenu;
    RadMenuItem foundMenuItem = foundMenu.FindItemByValue("ToggledMenuItem");
    ... // null checks
    foundMenuItem.Enabled = true;

    However, even with Enabled = true, the menu item is still displaying as disabled. Is there some sort of UI refresh that needs to occur in order to enforce the change?
  7. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 07 May 2013 Link to this post

    Hello Liz,

    I tested the scenario that you describe but I was not able to replicate the issue that you are getting. attached to this post you can find my testing page. Please give it a try and let me know how it goes from your side. Can you also modify it in a way that it demonstrates the issue that you have and send it back to me so I can observe it from my side? 

    All the best,
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017