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

RadMenuItem Icon not showing using StaticResource

1 Answer 246 Views
Menu
This is a migrated thread and some comments may be shown as answers.
TM
Top achievements
Rank 1
TM asked on 18 Feb 2011, 10:20 PM
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>

1 Answer, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 23 Feb 2011, 10:54 AM
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!
Tags
Menu
Asked by
TM
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Share this question
or