New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Xml String Binding

  • Amsterdam
  • Barcelona
  • Bonn
  • Boston
  • Brussels
  • Dallas
  • Denver
  • Dublin
  • Liverpool
  • London
  • Madrid
  • Miami
  • Moscow
  • New York
  • Oslo
  • Paris
  • San Francisco
  • Seattle
  • Sofia
  • St.Paul

You can easily populate RadListBox from XML. To populate RadListBox from an XML file use the LoadContentFile method. To populate RadListBox from XML string use the LoadXml method.

C#

RadListBox1.LoadContentFile("ListBox.xml");
RadListBox2.LoadXml("<Items><Item Text=\"One\" /><Item Text=\"Two\" /></Items>");

VB.NET

RadListBox1.LoadContentFile("ListBox.xml")
RadListBox2.LoadXml("<Items><Item Text=\"One\" /><Item Text=\"Two\" /></Items>")
  • DefaultVB.aspx
  • DefaultVB.aspx.vb
  • ListBox.xml
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="DefaultVB.aspx.vb" Inherits="ListBox.Examples.PopulatingWithData.XmlStringBinding.DefaultVB" %>

<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container size-thin">
        <telerik:RadListBox RenderMode="Lightweight" runat="server" ID="RadListBox1" Width="300px" Height="200px">
        </telerik:RadListBox>
    </div>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance