RadMenuItem Visible Not Working

4 posts, 0 answers
  1. Rob
    Rob avatar
    2 posts
    Member since:
    Dec 2011

    Posted 16 Mar 2012 Link to this post

    I'm trying to set the visiblity of a RadMenuItem based on code.  I've seen some other posts but they seem rather difficult or sloppy to maintain.  My end goal is to run it through a function that will return true or false.  I've simplified it for discussion purposes. 

    This code below should work.  But it doesn't.  Any ideas?

    <telerik
    :RadMenuItem runat="server" NavigateUrl="~/users/manage_users.aspx" Text="Users" Visible='<%# "false" %>'>

    </telerik:RadMenuItem>



    I don't get an error but the menu item still shows.

    Any ideas?

    Thanks,
    Rob
  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 21 Mar 2012 Link to this post

    Hi Rob,

    Thank you for contacting us.

    Can you elaborate a bit more on your scenario? Do you need to use a binding expression that will take a particular value from your database and assign it to the Visible property or you are trying to assign a simple value to this 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 WinForms is Visual Studio 2017 Ready
  4. Rob
    Rob avatar
    2 posts
    Member since:
    Dec 2011

    Posted 25 Mar 2012 Link to this post

    In this scenario, I want to use Roles to show/hide the visible property.  Some links are for Admin only.  Some links are for Sales people only, etc...
  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 28 Mar 2012 Link to this post

    Hi Rob,

    I am not quite sure about the approach that you use in order to hide/show menu items depending on the different user roles but I can suggest few post where a very similar functionality is implemented. For example  the following post explains in details how you can achieve the desired logic: Can i hide/ show asp:Menu items based on role? Since this article is related to the asp menu control, however, I would also suggest that you use any of the properties described in the following help article Accessing Items to find the menu items that needs to be hidden/shown when a user logs as a different role.

    Kind regards,
    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