RadMenuItem Container

4 posts, 0 answers
  1. Harald Braunstein
    Harald Braunstein avatar
    11 posts
    Member since:
    Sep 2006

    Posted 09 Mar 2009 Link to this post

    Is it somehow possible to access the container of RadMenuItems ? For example I would like to have all RadMenuItems in some custom control (i.e. scrollviewer or anything else).
  2. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 09 Mar 2009 Link to this post

    Hi Harald Braunstein,

    Can you collaborate more on what you want to achieve?
    If you want to change the panel in which RadMenuItems are added you can use ItemsPanel property.
    Here is sample code demonstrating how to change the ItemsPanel:
    <telerik:RadMenuItem Header="File">     
       <telerik:RadMenuItem.ItemsPanel>    
          <ItemsPanelTemplate>    
             <core:RadWrapPanel Orientation="Vertical" Height="400"/>     
          </ItemsPanelTemplate>    
       </telerik:RadMenuItem.ItemsPanel>    
       <telerik:RadMenuItem Header="Open"/>     
       <telerik:RadMenuItem Header="Save"/>     
       <telerik:RadMenuItem Header="Close"/>     
       <telerik:RadMenuItem Header="Exit"/>     
    </telerik:RadMenuItem>    
     


    Greetings,
    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. Harald Braunstein
    Harald Braunstein avatar
    11 posts
    Member since:
    Sep 2006

    Posted 10 Mar 2009 Link to this post

    Well, thats what I already know. I need to deeply modify the item container to contain also other controls, not just items - for example something like this.
    <telerik:RadMenuItem Header="A"
    <StackPanel> 
    <MyCustomControl/> 
    <telerik:RadMenuItem Header="B"
    <telerik:RadMenuItem Header="C"
    <telerik:RadMenuItem Header="D"
    </StackPanel> 
    </telerik:RadMenuItem> 
  5. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 12 Mar 2009 Link to this post

    Hi Harald Braunstein,

    To put some static content in all RadMenuItems you can modify the control template and put this controls there. But this is a custom case because I guess you will want different controls for different menuItems. This can be done if you set data object as ItemsSource to RadMenu and specify different DataTemplates using RadMenu.ItemTemplateSelector. Using ItemTemplateSelector you will be able to specify different templates for all menu items.

    Let me know if you need more information.

    All the best,
    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.
Back to Top