<telerikNavigation:RadContextMenu.ContextMenu>
<telerikNavigation:RadContextMenu Opened="RadContextMenu_Opened" ItemClick="RadContextMenu_ItemClick">
<telerikNavigation:RadContextMenu.Items>
<telerikNavigation:RadMenuItem Header="Start Product"
Icon="/FastDash;Component/Assets/Images/start_product_16.png" />
<telerikNavigation:RadMenuItem Header="Edit"
Icon="/FastDash;Component/Assets/Images/edit_16.png" />
<telerikNavigation:RadMenuItem Header="Upload Document"
Icon="/FastDash;Component/Assets/Images/document_16.png"/>
<telerikNavigation:RadMenuItem Header="View Details"
Icon="/FastDash;Component/Assets/Images/view_16.png"/>
<telerikNavigation:RadMenuItem Header="Copy"
Icon="/FastDash;Component/Assets/Images/cell_copy_16.png"/>
</telerikNavigation:RadContextMenu.Items>
</telerikNavigation:RadContextMenu>
</telerikNavigation:RadContextMenu.ContextMenu>
Thanks!
Lana
7 Answers, 1 is accepted
I have exactly the same problem. After upgrading controls to Q3 RadItem's Icons are displayed as a text! Obviously something has changed ...
Regards
Since Q3 the behaviour of the Icon property is changed, in order to enable showing a text in this space. To put an image for an icon you will have to set the IconTemplate property of the RadMenuItem, for example:
<telerik:RadMenuItem Header="Start Product"/> <telerik:RadMenuItem.IconTemplate> <DataTemplate> <Image Source="/FastDash;Component/Assets/Images/start_product_16.png Stretch="UniformToFill"/> </DataTemplate> </telerik:RadMenuItem.IconTemplate> <telerik:RadMenuItem/>Hope this information helps. If you have any other inquiries please let us know.
Kind regards,
Konstantina
the Telerik team
thank you very much! Everything now works as before!
Best regards,
My application has dozens of context menus, each with several menu items. Having to go back in and add this to my entire project is going to be very time consuming.
Why didn't you leave the original way of doing this in the control for backwards compatibility purposes?
Thank you for your question.
In order to enable the display of a text in the icon space, we had to change the Icon property behaviour. Now, the right way to add an Image for an Icon is to define the IconTemplate property.
Sorry for the caused inconvenience.
Please feel free to contact us again if you have further questions.
Sincerely yours,
Konstantina
the Telerik team
I have the same Problem (Icons showing as text, something cut like Sys...), but I'm not using the XAML Menu.
I've got this code:
RadContextMenu radContextMenu = new RadContextMenu();<br> radContextMenu.Opened += new RoutedEventHandler(radContextMenu_Opened);<br> RadMenuItem AddSubject = new RadMenuItem();<br> AddSubject.Header = "Schulstunde hinzufügen";<br> AddSubject.Icon = (DataTemplate)this.Resources["AddTemp"];<br> AddSubject.Click += new Telerik.Windows.RadRoutedEventHandler(AddSubject_Click);<br> radContextMenu.Items.Add(AddSubject);In the XAML Ressources I build the following template:
<UserControl.Resources><br> <DataTemplate x:Key="AddTemp"><br> <Image Source="/SchedulerGridView;component/Images/Add-64.png" Stretch="UniformToFill"/><br> </DataTemplate><br> </UserControl.Resources>I've no Idea why this won't work for me.
Thank you in advance for your help.
regards
Daniel
No matter set in code behind or in xaml the Icon property still has changed behaviour. To make it work you will have to set the IconTemplate property:
RadMenuItem AddSubject = new RadMenuItem(); AddSubject.Header = "Schulstunde hinzufügen"; AddSubject.IconTemplate = (DataTemplate)this.Resources["AddTemp"]; AddSubject.Click += new Telerik.Windows.RadRoutedEventHandler(AddSubject_Click);Hope this info helps. Please let us know if you still experience any difficulties.
Best wishes,
Konstantina
the Telerik team