Problems with Icon in RadMenuItem

15 posts, 0 answers
  1. Fedor Uba
    Fedor Uba avatar
    7 posts
    Member since:
    Oct 2009

    Posted 12 Nov 2010 Link to this post

    It doesn't show the image. The problem occurs after updated to Q3.
    
    
    <toolkit:RadContextMenu.ContextMenu>
        <toolkit:RadContextMenu ItemClick="contextMenu_Copy_Click" Opened="contextMenu_Opened">
            <toolkit:RadMenuItem Header="Copy" Icon="/documents_plus.png" />
        </toolkit:RadContextMenu>
    </toolkit:RadContextMenu.ContextMenu>
  2. Paolo
    Paolo avatar
    423 posts
    Member since:
    Jun 2009

    Posted 15 Nov 2010 Link to this post

    Same problem here....... hope it will be fixed soon with an hotfix.....
    thanks
  3. DevCraft banner
  4. DenisCL
    DenisCL avatar
    69 posts
    Member since:
    Dec 2009

    Posted 15 Nov 2010 Link to this post

    Same issue
  5. Paolo
    Paolo avatar
    423 posts
    Member since:
    Jun 2009

    Posted 15 Nov 2010 Link to this post

    I've found a solution, considering that this is not a real problem....... I also think that icon should be an image and not a string.....
    here' my code :

    Old code

    <telerik:RadMenuItem Icon="./Images/16x16/image.png" Header="Accounts" Tag="1" >

     

    </telerik:RadMenuItem>

    New code :

     

     

     

    <telerik:RadMenuItem Header=Accounts" Tag="1">

     

     

     

     

    <telerik:RadMenuItem.Icon>

     

     

     

     

    <Image Source="./Images/16x16/image.png"></Image>

     

     

     

     

    </telerik:RadMenuItem.Icon>

     

    </telerik:RadMenuItem>

    Hope it helps
    Ciao

     

  6. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 15 Nov 2010 Link to this post

    Hello all,

    In order to enable the display of a text in the icon space, we had to change the Icon property behaviour. Since Q3 to put an Image for an Icon you will have to define the IconTemplate, as follows:

    <toolkit:RadContextMenu.ContextMenu>    
        <toolkit:RadContextMenu ItemClick="contextMenu_Copy_Click" Opened="contextMenu_Opened">        
            <toolkit:RadMenuItem Header="Copy">
                <toolkit:RadMenuItem.IconTemplate>
                     <DataTemplate>
                        <Image Source="/documents_plus.png"/>
                     </DataTemplate>
                </toolkit:RadMenuItem.IconTemplate>
         </toolkit:RadContextMenu>
    </toolkit:RadContextMenu></toolkit:RadContextMenu.ContextMenu>
    Sorry for the caused inconvenience.

    If you have further questions please let us know.

    Best wishes,
    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. DenisCL
    DenisCL avatar
    69 posts
    Member since:
    Dec 2009

    Posted 15 Nov 2010 Link to this post

    Working.
    Thanks Paolo.

    Konstantina, is it deduceable from a patch note ?
    I did'nt read anything about that, but I may miss something.
  8. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 18 Nov 2010 Link to this post

    Hi Denis,

    Sorry for the omission.

    We will do our best to update the help documentation as soon as possible.
    Please accept our apologies for the caused inconvenience.

    Feel free to contact us again if you have any other inquiries.

    All the best,
    Konstantina
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  9. john
    john avatar
    12 posts
    Member since:
    Feb 2008

    Posted 27 Apr 2011 Link to this post

    For some reason this is not working for me, I'm still getting blank Icons 
    I'm using the latest build of Silverlight Controls,... 


    <telerik:RadMenuItem Header="Refresh Images" Tag="1">
        <telerik:RadMenuItem.IconTemplate>
                <DataTemplate>
                        <Image Source="../images/photos.jpg" Height="16" Width="16"/>
                    </DataTemplate>
            </telerik:RadMenuItem.IconTemplate>                                                                                                                                   
    </telerik:RadMenuItem>

    I have double checked the image is a good image path
  10. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 28 Apr 2011 Link to this post

    Hello John,

    Could you please prepare a sample project in which this issue can be observed and send it back to us. In that way we will be able to track down the source of the problem and provide you with solution. Also, could you please try with the latest internal build available.

    Looking forward to your reply.

    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
  11. john
    john avatar
    12 posts
    Member since:
    Feb 2008

    Posted 29 Apr 2011 Link to this post

    I apologize... it does seem to appear to be an Image path issue... the code I posted above does work just fine ..
    -john
  12. Denis Vuyka
    Denis Vuyka avatar
    39 posts
    Member since:
    Oct 2009

    Posted 06 Jun 2011 Link to this post

    Hello,
    We have a great amount of menu items corrupted because of this non-obvious change in the behavior. We've been using the following image uri format for items: "/<Assembly>;component/<PathToImage>" and now it is not working with Q1 2011. 
    Having IconTemplate is great, but creating tones of XAML markup just to define an icon in the existing code is not very good.
    Denis
  13. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 07 Jun 2011 Link to this post

    Hello Denis,

    What do you mean with "this non-obvious change"? We haven't change Icon behaviour in the recent Q's.
    How do you set icons?

    Best wishes,
    Hristo
    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
  14. Denis Vuyka
    Denis Vuyka avatar
    39 posts
    Member since:
    Oct 2009

    Posted 07 Jun 2011 Link to this post

    We are migrating from Q2 2010 SP2 to Q1 2011 SP1 right now and the process is smooth except some minor issues and changes to RadMenuItem icons. We have a lot of different components using RadRibbon with drop-down buttons, set of context menus, etc. All referencing images in the common pack uri fashion.
    Now we have to perform a full retest just to find out the broken icons and developers will need to write more xaml to use either Icon Templates or nested Image tags. 
    By saying "non-obvious" I mean that 1) this was not mentioned in the "what's changed" notes and 2) please correct me if I'm wrong but every Silverlight developer dealing with standard Silverlight sdk/toolkit controls has already got used to resource/pack uris when dealing with images and their sources. You can either specify an image explicitly or provide uri within XAML. This dual definition nature is what is missing in latest Telerik suites.
    I understand that there might be technical reasons for that but I guess it is not very difficult from development perspective to support the expected dual nature for RadMenuItem as well. This will help your customers avoiding painful upgrade/migration processes and will be intuitive for Silverlight developers using Telerik suite for the first time.
    Thanks,
    Denis
  15. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 08 Jun 2011 Link to this post

    Hello Denis,

    Indeed there was support for URI which we implicitly converted to an Image. But then in 2010 Q3 we have added IconTemplate so automatic conversion would break when using it (e.g. if we manually create an image and set it to Icon property the DataContext of IconTemplate would be this image which is not expecting).
    There was another issue with Uri.IsWellFormedUriString - it was returning true for "1" which is definitely case in which we don't want to create implicit image control.

    In your scenario the fastest approach would be to set Icon to the URI (like before) and set Style for RadMenuItem in which you set IconTemplate which is Image Source="{Binding}".
    This way the style will be applied to all RadMenuItems and it will work as before.

    As for the release notes - it is our mistake that we missed to add it to (the change was made before 2010 Q3).
    Sorry for the caused inconvenience.

    All the best,
    Hristo
    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
  16. Denis Vuyka
    Denis Vuyka avatar
    39 posts
    Member since:
    Oct 2009

    Posted 08 Jun 2011 Link to this post

    Hello Hristo,
    Thanks for the response. Now that makes sense for me.
    Using Styles is a great idea and I think that will work fine for me.
    Thanks,
    Denis
Back to Top
DevCraft banner