More in this section

Forums / Developing with Sitefinity / Step by step radPanelbar

Step by step radPanelbar

4 posts, 0 answered
  1. Chris
    Chris avatar
    6 posts
    Registered:
    18 Jun 2007
    14 Jul 2008
    Link to this post
    is there a step by step guide for binding the radPanelbar to an XMLdata source?
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    15 Jul 2008
    Link to this post
    Hi Alex,

    Please refer to the following online example that describes how to bind RadPanelBar to various types of data sources, including XmlDataSource.

    Do let us know if you need any further assistance.

    Best wishes,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Chris
    Chris avatar
    6 posts
    Registered:
    18 Jun 2007
    15 Jul 2008
    Link to this post
    Thanks for the reply... in using the XML Data source the RadPanelBar displays the XML node name and not the text value. What do I need to configure to make it display the text="Step 1" value?

  4. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    16 Jul 2008
    Link to this post
    Hi Alex,

    I am not sure I fully understand your question. What do you mean by "RadPanelBar displays the XML node name and not the text value"?

    XmlDataSource control represents the XML data loaded from an XML file which is indicated by the DataFile property. So you need to have an XML file (panelbar.xml) like this one:

    <?xml version="1.0" encoding="utf-8" ?> 
    <PanelItems Text="All Panel Items"
      <PanelItem Text="Step 1" Value="Step 1" Expanded="True" > 
        <PanelItem Text="Step 1.1" Value="Step 1.1" /> 
        <PanelItem Text="Step 1.2" Value="Step 1.2" /> 
        <PanelItem Text="Step 1.3" Value="Step 1.3" /> 
        <PanelItem Text="Step 1.4" Value="Step 1.4" /> 
      </PanelItem> 
      <PanelItem Text="Step 2"
        <PanelItem Text="Step 2.1" Value="Step 2.1" /> 
        <PanelItem Text="Step 2.2" Value="Step 2.2" /> 
        <PanelItem Text="Step 2.3" Value="Step 2.3" /> 
        <PanelItem Text="Step 2.4" Value="Step 2.4" /> 
      </PanelItem> 
    </PanelItems> 

    After that you need to create a user control that wraps RadPanelBar control and XmlDataSource. Please note that properties such as Text, Value and NavigateUrl are not automatically populated and you should map them by setting the DataTextField, DataValueField and DataNavigateUrlField properties:

    .ascx
     <asp:XmlDataSource runat="server" ID="XmlDataSource1" DataFile="panelbar.xml"></asp:XmlDataSource> 
     <telerik:RadPanelBar 
             id="RadPanelBar1" 
             runat="server" 
             DataSourceID="XmlDataSource1" 
             DataTextField="Text" 
             DataValueFiled="Value"
    </telerik:RadPanelBar> 

    And finally you should register the newly created user control in the <toolboxControls> section of the project web.config file to display it in the toolbox:

    <add name="Panelbar Wrapper" section="Navigation" url="~/Sitefinity/UserControls/Navigation/PanelBarWrapper.ascx"/> 

    You can also find useful information
    how to bind RadPanelBar to an XmlDataSource in the following online article.

    Please explain in details if there is something unclear.

    Greetings,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
4 posts, 0 answered