RadMenuItem set to different pages

4 posts, 0 answers
  1. Robin
    Robin avatar
    10 posts
    Member since:
    Sep 2015

    Posted 06 Sep Link to this post

    I have a radmenu and one of the radmenuitems needs to be set to differernt pages depending on session variable.  The other menuitems are static. 

    I have tried navigateurl='<%# session("pageid")%>

    The first menuitem is the one I want to be dynamic

     

    here is my radmenu code

     <telerik:RadMenu runat="server" ID="radMenu2" Style="vertical-align:middle; width: 74%; margin: 0 auto;padding-right:5px; padding-bottom: 15px; padding-top: 10px;"  RenderMode="Lightweight"  >
                      <Items>
                          <telerik:RadMenuItem runat="server" Text="Letter of Intent/Proposal" Font-Names="Trebuchet MS" Font-Size="12pt" navigateurl='<%#Session("pageName") %>'></telerik:RadMenuItem>
                          <telerik:Radmenuitem text ="Letter of Intent/Proposal"  font-size="12pt" Font-Names="Trebuchet MS" runat="server"
               enabled="true" >
                    </telerik:Radmenuitem>
              <telerik:Radmenuitem text ="Third Party Information" font-size="12pt" Font-Names="Trebuchet MS" runat="server"
               >
                    </telerik:Radmenuitem>
                       <telerik:radmenuitem text="Essentials" runat="server" font-size="12pt" Font-Names="Trebuchet MS" navigateurl="/mssApplications/essentialinfo.aspx"></telerik:radmenuitem>
                     
                    <telerik:radmenuitem text="Focus" runat="server" font-size="12pt" Font-Names="Trebuchet MS" navigateurl="/mssApplications/focus.aspx"></telerik:radmenuitem>
                  
                    <telerik:radmenuitem text="Award Design" runat="server" font-size="12pt" Font-Names="Trebuchet MS" navigateurl="/mssApplications/awardDesign.aspx"></telerik:radmenuitem>
                   <telerik:radmenuitem text="Student Support" runat="server" font-size="12pt" Font-Names="Trebuchet MS" navigateurl="/mssApplications/studentsupport.aspx"></telerik:radmenuitem>

                    <telerik:radmenuitem text="Narrative" runat="server" font-size="12pt" Font-Names="Trebuchet MS" navigateurl="/mssApplications/Narrative.aspx"></telerik:radmenuitem>
                    
                    <telerik:radmenuitem text="Invoice Schedule" runat="server" font-size="12pt" Font-Names="Trebuchet MS"  navigateurl="/mssApplications/invoiceSchedule.aspx"></telerik:radmenuitem>
                    
                    <telerik:radmenuitem text="Grant Documents" runat="server" font-size="12pt" Font-Names="Trebuchet MS" navigateurl="/mssApplications/grantdocuments.aspx"></telerik:radmenuitem>
                    </items>
                    </telerik:radmenu>

     

    Thank you

  2. Eyup
    Admin
    Eyup avatar
    3862 posts

    Posted 11 Sep Link to this post

    Hello Robin,

    This syntax is a databinding-expression and it will work only when the RadMenu is bound, for instance:
    protected void Page_Load(object sender, EventArgs e)
    {
        radMenu2.DataBind();
    }

    Alternatively, you can traverse the existing RadMenu items in the PreRender event and change the NavigateUrl programmatically. The traversing can happen either by using the radMenu2.Items collection or FindItemByText or FindItemByValue.

    That should resolve the issue. Feel free to give it a try and let me know about the result. 

    Regards,
    Eyup
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Robin
    Robin avatar
    10 posts
    Member since:
    Sep 2015

    Posted 09 Oct in reply to Eyup Link to this post

    Ok,  i added the radmenu1.databind to my page load

    code

       Protected Sub Page_Load(sender As Object, e As EventArgs)
         
            Dim appid = Session("appid")
     
            Dim apptypeid = Session("apptypeid")
       
            radMenu1.DataBind()

            If Session("usertype") = 1 Then
                Session("pageid") = "admin/viewapps.aspx?type=1"
            Else
                Session("pageid") = "dashboard/mainpage.aspx"
            End If

        End Sub

     

    in my radmenu I put

         <telerik:RadMenuItem Text="Existing Applications" Font-Size="12pt" Font-Names="Trebuchet MS" runat="server"
                        navigateurl='<%# session("pageid") %>'>
                    </telerik:RadMenuItem>

     

    clicking the menu item doesnt call anything

  4. Eyup
    Admin
    Eyup avatar
    3862 posts

    Posted 10 Oct Link to this post

    Hello Robin,

     

    In this case, could you prepare a very basic runnable sample to demonstrate this issue and open a formal support ticket to send it to us? This will enable us to further investigate the issue locally and provide more accurate and precise solutions.

     

    Regards,
    Eyup
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top