This is a migrated thread and some comments may be shown as answers.

Open new Page referenced in a RadMenuItem's Tag

1 Answer 58 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Fabricio Frontarolli
Top achievements
Rank 1
Fabricio Frontarolli asked on 21 Dec 2010, 01:08 PM

Guys,

Each RadMenuitem has a Tag.

I would like to reference each RadMenuItem's Tag to a particular Page that I have created, and open in a new RadWindow.

The code below illustrates more or less what I need.

<telerik:RadMenu Name="radMenu1" >
      <telerik:RadMenuItem         Header="Operational" >
             <telerik:RadMenuItem  Header="Customers"  Tag="Customer.xaml" Click="Navigate"  />
             <telerik:RadMenuItem  Header="Products"    Tag="Products.xaml" Click="Navigate"  />
      </telerik:RadMenuItem>
</telerik:RadMenu>

C# code:

private void Navigate(object sender, Telerik.Windows.RadRoutedEventArgs e)
{
     RadWindow floatableWindow = new RadWindow()
     {
        Width   = 900,
        Height  = 450,
        Content = (sender as RadMenuItem).Tag
     };
   floatableWindow.Show();
}

Is it possible to be done? Is there another way to do that?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 27 Dec 2010, 11:16 AM
Hi Fabricio Frontarolli,

I will recommended you using a HyperlinkButton placed inside the RadMenuItem. So instead of using the Tag property of the menu item you can put the page address directly into the NavigateUri, without handling the code behind's click event.

Greetings,
Kaloyan
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
Menu
Asked by
Fabricio Frontarolli
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Share this question
or