AddHandler for RadMenuItem

6 posts, 0 answers
  1. mvbaffa
    mvbaffa avatar
    102 posts
    Member since:
    Dec 2006

    Posted 13 Mar 2009 Link to this post

    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.

  2. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 14 Mar 2009 Link to this post

    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.
  3. DevCraft banner
  4. mvbaffa
    mvbaffa avatar
    102 posts
    Member since:
    Dec 2006

    Posted 14 Mar 2009 Link to this post

    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
  5. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 16 Mar 2009 Link to this post

    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.
  6. Adrian Pay
    Adrian Pay avatar
    28 posts
    Member since:
    Nov 2009

    Posted 13 Aug 2010 Link to this post

    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!
  7. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 13 Aug 2010 Link to this post

    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
Back to Top
DevCraft banner