xmldatasource show gif in menu

2 posts, 1 answers
  1. Jomey
    Jomey avatar
    60 posts
    Member since:
    Jan 2008

    Posted 11 Apr 2008 Link to this post

    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>

  2. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 14 Apr 2008 Link to this post

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