Navigation from Menu control

3 posts, 0 answers
  1. Vit100
    Vit100 avatar
    66 posts
    Member since:
    Oct 2012

    Posted 27 Apr 2010 Link to this post

    Hi guys,
    I am using Microsoft Business Template for my application and would like to use RadMenu instead of default hyperlink buttons.
    Can U give me an idea how to achive this?

    I created Menu and MenuItems. Then what? How to make navigation?
    Telerik navigations was left only for compatibility, right?

    I started using this way of navigating, but now sure is it correct.

    <RadMenuItem name="RadMenuItem1" header="about page" tag="/About"/>
    in event handler for the RadMenuItem:




    .ContentFrame.Navigate(new Uri(RadMenuItem1.Tag.ToString(),UriKind.RelativeOrAbsolute));


    Is this usage of the menu correct or there is more elegant way?

  2. Hristo
    Hristo avatar
    832 posts

    Posted 29 Apr 2010 Link to this post

    Hello Vitaliy,

    This usage is ok. But if you want more elegant solution then you could you radMenuItem.Command property and CommandParameter to execute command (like NavigateCommand for example - you have to create such command). In the command parameter you could specify the page to which you have to navigate. And if you use RoutedCommand then you can handle the command in the MainPage and navigate to the page in the parameter.

    I'm attaching simple project demonstrating this approach.
    Let us know if you need more information.

    Kind regards,
    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. Brian
    Brian avatar
    58 posts
    Member since:
    Jul 2011

    Posted 27 Sep 2011 Link to this post

    I'd like to add for anyone trying to use the provided example in their own code: it is critical that NavigationCommands.RegisterNavigarionCommands is called before InitializeComponent is called, otherwise, the event will not fire when the menu item is clicked.  This threw me off for awhile.
Back to Top