RadContextMenu Icon displays as Text

8 posts, 0 answers
  1. Lana
    Lana avatar
    13 posts
    Member since:
    Jul 2010

    Posted 11 Nov 2010 Link to this post

    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
  2. Sandi Markon
    Sandi Markon avatar
    101 posts
    Member since:
    Jul 2012

    Posted 12 Nov 2010 Link to this post

    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
  3. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 12 Nov 2010 Link to this post

    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
  4. Sandi Markon
    Sandi Markon avatar
    101 posts
    Member since:
    Jul 2012

    Posted 12 Nov 2010 Link to this post

    Hi Konstantina,

    thank you very much! Everything now works as before!

    Best regards,
  5. Lee Weisenberger
    Lee Weisenberger avatar
    72 posts
    Member since:
    Nov 2009

    Posted 12 Nov 2010 Link to this post

    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?
  6. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 15 Nov 2010 Link to this post

    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
  7. Daniel K.
    Daniel K. avatar
    3 posts
    Member since:
    Oct 2009

    Posted 03 Mar 2011 Link to this post

    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
  8. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 04 Mar 2011 Link to this post

    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!
Back to Top