This is a migrated thread and some comments may be shown as answers.
Problems with Icon in RadMenuItem
14 Answers 213 Views
This is a migrated thread and some comments may be shown as answers.
Fedor Uba
Top achievements
Rank 1
Fedor Uba asked on 12 Nov 2010, 02:41 PM
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>

14 Answers, 1 is accepted

Sort by
0
Michele
Top achievements
Rank 2
answered on 15 Nov 2010, 10:53 AM
Same problem here....... hope it will be fixed soon with an hotfix.....
thanks
0
DenisCL
Top achievements
Rank 1
answered on 15 Nov 2010, 11:22 AM
Same issue
0
Michele
Top achievements
Rank 2
answered on 15 Nov 2010, 11:27 AM
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

 

0
Konstantina
Telerik team
answered on 15 Nov 2010, 12:03 PM
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
0
DenisCL
Top achievements
Rank 1
answered on 15 Nov 2010, 02:08 PM
Working.
Thanks Paolo.

Konstantina, is it deduceable from a patch note ?
I did'nt read anything about that, but I may miss something.
0
Konstantina
Telerik team
answered on 18 Nov 2010, 08:54 AM
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
0
john
Top achievements
Rank 1
answered on 27 Apr 2011, 05:11 PM
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
0
Konstantina
Telerik team
answered on 28 Apr 2011, 11:14 AM
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
0
john
Top achievements
Rank 1
answered on 29 Apr 2011, 08:26 PM
I apologize... it does seem to appear to be an Image path issue... the code I posted above does work just fine ..
-john
0
Denis Vuyka
Top achievements
Rank 1
answered on 06 Jun 2011, 02:53 PM
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
0
Hristo
Telerik team
answered on 07 Jun 2011, 07:20 AM
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
0
Denis Vuyka
Top achievements
Rank 1
answered on 07 Jun 2011, 09:56 AM
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
0
Hristo
Telerik team
answered on 08 Jun 2011, 08:37 AM
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
0
Denis Vuyka
Top achievements
Rank 1
answered on 08 Jun 2011, 09:51 AM
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
Tags
Menu
Asked by
Fedor Uba
Top achievements
Rank 1
Answers by
Michele
Top achievements
Rank 2
DenisCL
Top achievements
Rank 1
Konstantina
Telerik team
john
Top achievements
Rank 1
Denis Vuyka
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or