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

RadContextMenu Icon displays as Text

7 Answers 214 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Lana
Top achievements
Rank 1
Lana asked on 11 Nov 2010, 04:04 PM
I just upgraded to the Quarter 3 release of the Silverlight controls, and now my Icons in all of my RadContextMenus are displaying as text where they displayed as the icon before.  Is there something different that I need to do now to get them to display the actual icon?  Here is an example of how I have set up my context menu.

 

 

 

<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

Sort by
0
Sandi Markon
Top achievements
Rank 1
answered on 12 Nov 2010, 08:49 AM
Hello,

I have exactly the same problem. After upgrading controls to Q3 RadItem's Icons are displayed as a text! Obviously something has changed ...

Regards
0
Konstantina
Telerik team
answered on 12 Nov 2010, 10:00 AM
Hello guys,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Sandi Markon
Top achievements
Rank 1
answered on 12 Nov 2010, 01:53 PM
Hi Konstantina,

thank you very much! Everything now works as before!

Best regards,
0
Lee
Top achievements
Rank 1
answered on 12 Nov 2010, 07:08 PM
This is a huge problem for me.

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?
0
Konstantina
Telerik team
answered on 15 Nov 2010, 11:55 AM
Hello Lee,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Daniel K.
Top achievements
Rank 1
answered on 03 Mar 2011, 03:21 PM
Hi,
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
0
Konstantina
Telerik team
answered on 04 Mar 2011, 12:53 PM
Hi 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
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
General Discussions
Asked by
Lana
Top achievements
Rank 1
Answers by
Sandi Markon
Top achievements
Rank 1
Konstantina
Telerik team
Lee
Top achievements
Rank 1
Daniel K.
Top achievements
Rank 1
Share this question
or