Rad Menu Show Path

2 posts, 0 answers
  1. ell
    ell avatar
    5 posts
    Member since:
    Apr 2007

    Posted 04 Jun 2008 Link to this post

    Could someone explain a method of making the Menu show path, no matter how deep the user goes. I have seen the way Telerik suggests, but I can not get it to work. Quite annoying:)

    Here's code: just a simple menu with child items:

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>

    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

    <!

    DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <

    html xmlns="http://www.w3.org/1999/xhtml" >

    <

    head runat="server">

    <title>Untitled Page</title>

    </

    head>

    <

    body>

    <form id="form1" runat="server">

    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">

    </telerik:RadScriptManager>

    <div>

    <telerik:RadMenu ID="RadMenu1" runat="server" Style="z-index: 21; left: 100px; position: absolute; top: 200px">

    <Items>

    <telerik:RadMenuItem runat="server" Text="Ferrari" NavigateUrl="ferrari.aspx">

    <Items>

    <telerik:RadMenuItem runat="server" Text="430" NavigateUrl="430.aspx">

    </telerik:RadMenuItem>

    <telerik:RadMenuItem runat="server" Text="599" NavigateUrl="599.aspx">

    </telerik:RadMenuItem>

    <telerik:RadMenuItem runat="server" Text="612 " NavigateUrl="612.aspx">

    </telerik:RadMenuItem>

    </Items>

    </telerik:RadMenuItem>

    <telerik:RadMenuItem runat="server" Text="Lamborghini" NavigateUrl="lamborghini.aspx">

    <Items>

    <telerik:RadMenuItem runat="server" Text="Gallardo" NavigateUrl="gallardo.aspx">

    </telerik:RadMenuItem>

    <telerik:RadMenuItem runat="server" Text="Murcielago" NavigateUrl="murcielago.aspx">

    </telerik:RadMenuItem>

    </Items>

    </telerik:RadMenuItem>

    <telerik:RadMenuItem runat="server" Text="Porsche" NavigateUrl="porsche.aspx">

    <Items>

    <telerik:RadMenuItem runat="server" Text="Boxster" NavigateUrl="boxster.aspx">

    </telerik:RadMenuItem>

    <telerik:RadMenuItem runat="server" Text="Cayman" NavigateUrl="cayman.aspx">

    </telerik:RadMenuItem>

    <telerik:RadMenuItem runat="server" Text="911" NavigateUrl="911.aspx">

    </telerik:RadMenuItem>

    <telerik:RadMenuItem runat="server" Text="Cayenne" NavigateUrl="cayenne.aspx">

    </telerik:RadMenuItem>

    </Items>

    </telerik:RadMenuItem>

    </Items>

    <CollapseAnimation Duration="200" Type="OutQuint" />

    </telerik:RadMenu>

    </div>

    </form>

    </

    body>

    </

    html>

    And the VB

    Partial

    Class Default2

    Inherits System.Web.UI.Page

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

    Dim item As String = Server.UrlDecode(Request("Item"))

    If Not String.IsNullOrEmpty(item) Then

    Dim currentItem As Telerik.Web.UI.RadMenuItem = RadMenu1.FindItemByText(item)

    If (Not (currentItem) Is Nothing) Then

    currentItem.HighlightPath()

    End If

    End If

    End Sub

    End

    Class

  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 04 Jun 2008 Link to this post

    Hello ell,

    The example you are using is relying on a query string parameter called "item". However in your case you are not specifying such a parameter. You can try a different technique - using the current url to find the corresponding menu item.
     Dim item As RadMenuItem = RadMenu1.FindItemByUrl(Request.Url.PathAndQuery) 
     If Not IsNothing(item) Then 
        item.HighlightPath() 
     End If 


    I hope this helps,
    Albert
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top