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

AddHandler for RadMenuItem

5 Answers 151 Views
Menu
This is a migrated thread and some comments may be shown as answers.
mvbaffa
Top achievements
Rank 1
mvbaffa asked on 14 Mar 2009, 03:05 AM
Hi,

I have just downloaded Telerik for Silverlight.

I am trying to drive the Click event of a RadMenuItem. According to the demo in Telerk site I have to:
menu.AddHandler(RadMenuItem.ClickEvent, new RoutedEventHandler(OnMenuItemClick));

The problem is that I receive the following error:

Error 1 'Telerik.Windows.Controls.RadMenu' does not contain a definition for 'AddHandler' and no extension method 'AddHandler' accepting a first argument of type 'Telerik.Windows.Controls.RadMenu' could be found (are you missing a using directive or an assembly reference?) D:\VS2008 Projects\Site\Site\userControls\CompanyHeader.xaml.cs 27 22 AssetKit

Any idea ???

Thanks in advance.

5 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 14 Mar 2009, 09:24 AM
Hello mvbaffa,

You need to include Teleik.Windows namespace in order to get the AddHandler extension method:
using Telerik.Windows; 

Let me know if you need more help.

Best wishes,
Hristo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
mvbaffa
Top achievements
Rank 1
answered on 14 Mar 2009, 02:55 PM
Hi,

I included Telerik.Windows.Controls, and I must include Telerik.Windows. It worked;

Bu the way where can I get information about using themes.

Thanks
0
Hristo
Telerik team
answered on 16 Mar 2009, 08:45 AM
Hello Marcus,

You can read about Application themes from here:
http://www.telerik.com/community/forums/silverlight/general-discussions/apply-themes-on-radcontrols-q1-2009.aspx#766512

If you want to apply theme only to RadMenu (and its RadMenuItems) then you can use the StyleManager.Theme="Vista" attached property:
<UserControl x:Class="SilverlightDockingDemo.Page51" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
    xmlns:nav="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
    Width="400" Height="300">  
   <Grid> 
      <nav:RadMenu telerik:StyleManager.Theme="Vista" /> 
   </Grid> 
</UserControl> 

Let me know if you need more information.

Regards,
Hristo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Adrian Pay
Top achievements
Rank 1
answered on 13 Aug 2010, 09:58 AM
Hi Hristo,

Is it possible to fire a click event to the parent RadMenuItem? Below is my xaml file using RadContextMenu and RadMenuItem:

<telerikRibbonBar:RadRibbonSplitButton.DropDownContent>
                        <telerikNavigation:RadContextMenu BorderThickness="0">
                            <telerikNavigation:RadMenuItem x:Name="parentMenu" Header="Parent Menu">
                                <telerikNavigation:RadMenuItem.Icon>
                                    <Image Source="/FSoft.FSuite.UI;Component/Images/EmployeeGRC.png" Stretch="Fill"/>
                                </telerikNavigation:RadMenuItem.Icon>
                                <telerikNavigation:RadMenuItem.Items>
                                    <telerikNavigation:RadMenuItem Header="Sub Menu 1" x:Name="submenu1" Click="submenu1_Click"/>
                                    <telerikNavigation:RadMenuItem Header="Sub Menu 2"  x:Name="submenu2" Click="submenu2_Click"/>
                                    <telerikNavigation:RadMenuItem Header="Sub Menu 3"  x:Name="submenu3" ItemsSource="{Binding}" Click="submenu3_Click">
                                    </telerikNavigation:RadMenuItem>
                                </telerikNavigation:RadMenuItem.Items>
                            </telerikNavigation:RadMenuItem>
                        </telerikNavigation:RadContextMenu>
                    </telerikRibbonBar:RadRibbonSplitButton.DropDownContent>

I have a parent Menu with 3 submenus which have it's corresponding click event. Is is possible to invoke a click event from the ParentMenu? I tried adding a click event in the xaml for the parent menu but it's not triggered when I click the Parent Menu. It will only be triggered if I click one of its sub menus.

Any ideas?

Thanks!
0
Hristo
Telerik team
answered on 13 Aug 2010, 12:15 PM
Hello Adrian Pay,

We are not aware of such behavior.
Please send us project where we can reproduce this issue.

Sincerely yours,
Hristo
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
Tags
Menu
Asked by
mvbaffa
Top achievements
Rank 1
Answers by
Hristo
Telerik team
mvbaffa
Top achievements
Rank 1
Adrian Pay
Top achievements
Rank 1
Share this question
or