RadMenuItem Icon not showing using StaticResource

2 posts, 0 answers
  1. TM
    TM avatar
    3 posts
    Member since:
    Feb 2011

    Posted 18 Feb 2011 Link to this post

    Hi,
    I have a multple gridview with RadContextMenu.  It all have the same menu items.... If set the property Icon="{StaticResource imgSearchMenu}" for RadMenuItem.. the image is not showing...

    Did I missed something here?

    Thank you in advance,
    TM

    -- Code--

    <UserControl.Resources>
    <DataTemplate x:Key="Col1">
                <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                    <TextBox Text="{Binding Path=col_name1}"  />
                </DockPanel>
            </DataTemplate>
    <DataTemplate x:Key="imgSearchMenu">
       <Grid>
    <Image Source="{lib:LocImage Key=Search,Dict=Resources,Assembly=MyApp.Client.Shell}" />
       </Grid>
    </DataTemplate>

    </UserControl.Resources>

    <telerik:RadGridView 
        Name="gridMyList"
        AutoGenerateColumns="False" 
        ShowGroupPanel="False" 
        ItemsSource="{Binding myList}"
        SelectedItem="{Binding currentRecord}">
        <telerik:RadGridView.Columns>
    <telerik:GridViewDataColumn
       Header="Col 1" 
       IsReadOnly="True"
       CellTemplate="{StaticResource Col1}" />
    <telerik:GridViewDataColumn 
        </telerik:RadGridView.Columns>
        <telerik:RadContextMenu.ContextMenu>
    <telerik:RadContextMenu
       Name="menu1" 
       Opened="RadContextMenu_Opened" 
       ItemClick="RadContextMenu_ItemClick">
       <telerik:RadContextMenu.Items>
    <telerik:RadMenuItem Header="Add" Icon="{StaticResource imgSearchMenu}" />
    <telerik:RadMenuItem Header="|" IsSeparator="True" />
    <telerik:RadMenuItem Header="Another item" />
       </telerik:RadContextMenu.Items>
    </telerik:RadContextMenu>
        </telerik:RadContextMenu.ContextMenu>
    </telerik:RadGridView>
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 23 Feb 2011 Link to this post

    Hi Ted,

    Could you please try to set the IconTemplate, instead of the Icon property of the RadMenu and see if that works. Also, you can refer to this forum post for more information.

    Hope this information helps. Please let us know if you have further questions.

    Best wishes,
    Konstantina
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top