Hiding Child Menu Item

2 posts, 0 answers
  1. Chad
    Chad avatar
    10 posts
    Member since:
    Feb 2013

    Posted 27 Feb 2014 Link to this post

    Hi,

    I was wondering how I would go about hiding a sub menu item based on the users permission rights.  I can hide the parent menu item just fine but I am having trouble getting at the child menu item.  Is this possible?  I am trying to hide the ACN Managment tab but keep the eligible recruits visible.

    Thanks,
    Chad

    Code below.

    <

     

     

    telerik:RadMenuItem Text="ACN" Value="ACN">

     

    <Items>

     

    <telerik:RadMenuItem Text="ACN MANAGEMENT">

     

    <Items>

     

    <telerik:RadMenuItem Text="Manage ACNS" NavigateUrl="ACN/ACNMangement.aspx"></telerik:RadMenuItem>

     

    <telerik:RadMenuItem Text="Manage Locks" NavigateUrl="ACN/ACNLocks.aspx"></telerik:RadMenuItem>

     

    <telerik:RadMenuItem Text="Manage Permissions" NavigateUrl="ACN/ACNPermissions.aspx"></telerik:RadMenuItem>

     

    <telerik:RadMenuItem Text="Request ACN" NavigateUrl="ACN/ACNRequest.aspx"></telerik:RadMenuItem>

     

    </Items>

     

    </telerik:RadMenuItem>

     

    <telerik:RadMenuItem Text="Eligible Recruits" NavigateUrl="ACN/EligibleRecruits.aspx"></telerik:RadMenuItem>

     

    </Items>

     

    </

    telerik

    :

    RadMenuItem

    >

    CODE BEHIND

     

     

    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load

     

    If Not IsPostBack Then

     

    'Get the name of the current User logged in.

     

    Dim Username As String = GetName()

    lblWelcome.Text =

     

    "Welcome " & Username

     

    End If

     

    'If CheckJ1Admin() = False Then

     

    ' Dim ACNMenu As RadMenuItem = rmMenu.Parent.FindChildByValue("ACN")

     

    ' ACNMenu.Visible = False

     

    'End If

     

    End Sub



     

     

     

     

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 27 Feb 2014 in reply to Chad Link to this post

    Hi Chad,

    Please try the following code snippet to hide the 'ACN Management' tab in RadMenu.

    VB:
    Dim item As RadMenuItem = DirectCast(RadMenu1.Items.FindItemByText("ACN").Items.FindItemByText("ACN MANAGEMENT"), RadMenuItem)
    item.Visible = False

    Let me know if you have any concern.
    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top