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

xmldatasource show gif in menu

1 Answer 61 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Jomey
Top achievements
Rank 1
Jomey asked on 12 Apr 2008, 12:10 AM

It binds - but the image doesn't show on the left of the text

<?

xml version="1.0" encoding="utf-8" ?>

<

ItemCollection>

<

Item Text="create" Url="~/Create.aspx" ImageUrl="~/App_Themes/Default/images/Images/create-menu.gif">

</

Item></ItemCollection>

<

telerik:RadMenu ID="RadMenu1" runat="server" Skin="Default2006"

DataSourceID="XmlDataSource1" DataTextField="Text"

DataNavigateUrlField="Url" Width="952">

<

CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

</telerik:RadMenu>

1 Answer, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 14 Apr 2008, 07:33 AM
Hello Jomey,

The ImageUrl property is not automatically populated when binding to XmlDataSource. You need to add a "binding" to hint RadMenu which XML attribute provides data for the ImageUrl property. Please check the following online example:

http://www.telerik.com/demos/aspnet/prometheus/Menu/Examples/Programming/DataBindings/DefaultCS.aspx

In your case you should add the binding like this:

<telerik:RadMenu ID="RadMenu1" runat="server" Skin="Default2006"  
DataSourceID="XmlDataSource1" DataTextField="Text" DataNavigateUrlField="Url" > 
    <DataBindings> 
        <telerik:RadMenuItemBinding ImageUrlField="ImageUrl"  /> 
    </DataBindings> 
</telerik:RadMenu> 

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Menu
Asked by
Jomey
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or