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

RadMenuItem.Image when selecting a resource image the name is messed up

1 Answer 67 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
Curtis asked on 16 Jan 2015, 11:31 PM
Take any RadMenu and put a RadMenuItem on it.
Select the RadMenuItem and change the Image property to any resource image (either import a new one or select an existing one.)
The form looks and acts and works correctly but...If you look at the Image property, the name is NOT the name of the selected resource.  Instead its a Base-64 Char array...

So the Property window doesnt tell you what resource was selected.

Is there any way to correct this?  Any help would be appreciated!

-Curtis

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 21 Jan 2015, 01:48 PM
Hi Curtis,

Thank you for writing.

By default we have an image converter that converts the image to base64 string. These strings are used by our theming functionality where the string can be converted to image. 

What you can do in this case is to create a custom menu item and use another image converter:
class MyItem : RadMenuItem
{
[TypeConverter(typeof(ImageConverter))]
    public override Image Image
    {
        get
        {
            return base.Image;
        }
        set
        {
            base.Image = value;
        }
    }
}

The above example uses the default .NET image converter but you can use your own as well. 

Please let me know if there is something else I can help you with. 
 
Regards,
Dimitar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Menu
Asked by
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Dimitar
Telerik team
Share this question
or