size of icon in MenuItem

2 posts, 0 answers
  1. Thomas Mutzl
    Thomas Mutzl avatar
    39 posts
    Member since:
    Oct 2006

    Posted 23 Sep 2011 Link to this post


    I have a databound RadContextMenu (as a DropDownContent of a RadRibbonSplittButton).
    The size of the icons I am binding to is 16 x 16, But they appear larger. So I asume, I have to style the Icon in the RadMenuItem and set the Stretch property to "None". But I have no idea how...

    Please have a look at the sceenshot and the code snippets.

    Thanks for any help!
        <telerik:HierarchicalDataTemplate ItemsSource="{Binding SubItems}"
                    <telerik:ContainerBinding PropertyName="Icon"
                                              Binding="{Binding SmallImage, Converter={StaticResource ImageConverter}, ConverterParameter=IgnoreTargetType}" />
                    <telerik:ContainerBinding PropertyName="Command"
                                              Binding="{Binding Command}" />
                    <telerik:ContainerBinding PropertyName="CommandParameter"
                                              Binding="{Binding CommandParameter, Mode=TwoWay}" />
                <TextBlock Text="{Binding Text}" />

        <DataTemplate x:Name="DropDownButtonWithContextMenuTemplate">         <telerik:RadRibbonDropDownButton Text="{Binding Text}"                                          Size="{Binding Size}"                                          CollapseToSmall="WhenGroupIsSmall"                                          CollapseToMedium="WhenGroupIsMedium"                                          LargeImage="{Binding LargeImage}"                                          SmallImage="{Binding SmallImage}"                                          Command="{Binding Command}"                                          CommandParameter="{Binding CommandParameter}">             <telerik:RadRibbonDropDownButton.DropDownContent>                 <telerik:RadContextMenu ItemsSource="{Binding Buttons}"                                         ItemTemplate="{StaticResource MenuItemTemplate}">                 </telerik:RadContextMenu>             </telerik:RadRibbonDropDownButton.DropDownContent>         </telerik:RadRibbonDropDownButton>     </DataTemplate>

  2. Pana
    Pana avatar
    748 posts

    Posted 28 Sep 2011 Link to this post

    Hello Thomas,

    I am pretty sure the ImageConverter build Image-es from URIs. Perhaps you could check the code of that converter and if it really creates an Image instances put the Stretch=None there.

    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft R3 2016 release webinar banner
Back to Top