From the previous user manuals that you have provided, you might now already know that Kettic ListBox DLL component supports data binding with data source like SqlDataSource, LinqDataSource, etc. Moreover, in this guiding page, we will provide you with detailed guidance as well as complete sample codes for listbox data binding with XML.
XML, abbreviated from Extensible Markup Language, as the name suggests, is a markup language that can be easily read with both human eyes and machines. It defines a set of rules and is widely used for encoding documents in a variety of scenarios.
In the following sections, we provides two methods for you to either bind a listbox to XML data source or directly bind to an XML file by loading it with simply a few lines of Visual C# .NET programming. Binding ListBox from XML DataSource
In this section, we will provide you with a simple demo for selecting an XML for listbox data source, please follow the procedure step by step to see how this works out.
![]() ![]() ![]() PerListBox.DataSourceID = "XmlDataSource1"; Binding ListBox from XML File
If you do not like Kettic ListBox data binding by selecting DataSource, you can opt for Plan B to directly load and import an XML file from your local disk with just a few lines of Visual C# .NET programming codes.
The demo codes below indicate how you can load an XML file named ListBox.xml from your local file for data binding. string xmlText = File.ReadAllText(
Please keep in mind that in order for both of the methods above to work, you need to have an XML file in advance which conforms to the format below: <?xml version="1.0" encoding="utf-8" ?>
Let's take a look at how this works out. Below is a simple screenshot of ListBox after binding to an XML file. ![]() | ![]() ASP.NET AJAX UI Controls ASP.NET AJAX Chart UI Control ASP.NET AJAX Grid UI Control ASP.NET AJAX Barcode UI Control ASP.NET AJAX Button UI Control ASP.NET AJAX Calendar UI Control ASP.NET AJAX NavigationBar UI Control ASP.NET AJAX Captcha UI Control ASP.NET AJAX Color Editor UI Control ASP.NET AJAX ComboBox UI Control ASP.NET AJAX DataPager UI Control ASP.NET AJAX Dock UI Control ASP.NET AJAX DropDownList UI Control ASP.NET AJAX DropDownTree UI Control ASP.NET AJAX HtmlEditor UI Control ASP.NET AJAX FileManager UI Control ASP.NET AJAX Filter UI Control ASP.NET AJAX Input UI Control ASP.NET AJAX ListBox UI Control OverviewGetting StartedElementsFeatures ReorderTransferDrag and DropButton ConfigurationCheckBoxesLoad On DemandTemplatesData Binding XML Data DataSource DataClient Prpgramming ListBox EventServer Prpgramming ListBox EventASP.NET AJAX ListView UI Control ASP.NET AJAX ToolBar UI Control ASP.NET AJAX TabControl UI Control ASP.NET AJAX Menu UI Control ASP.NET AJAX ToolTip UI Control |