Intersoft WebCombo Documentation
Walkthrough: Binding WebCombo to XML-based DataSource
See Also Send comments on this topic.
Intersoft WebCombo > WebCombo Features Overview > Data Binding Wakthroughs > Walkthrough: Binding WebCombo to XML-based DataSource

Glossary Item Box

This walkthrough shows you how to create and bind WebCombo to XML-based DataSource.

During this walkthrough, you will learn how to do the following:

 Prerequisites

In order to complete this walkthrough, you will need the following:

  • Access to the XML database.
  • Visual Studio 2005/2008/2010 Application.

 Step-By-Step Instructions

To create new web application and bind WebCombo to XML-based DataSource

  1. Launch Visual Studio.NET 2005.
  2. Click on File menu, then select New and click Web Site.
  3. Select ASP.NET Web Site in the Template box and set Location to HTTP.
  4. Named the Web Site and click OK.
  5. Right-click on Project's name and select Add New Item.
  6. Select Intersoft AppForm in the My Templates box and named it as Walkthrough.aspx.
  7. Drag WebCombo instance from ToolBar to WebForm.
  8. Double click the WebCombo instance and put the following code in WebCombo1_InitializeDataSource event :

    C# Copy Code
    protected void WebCombo1_InitializeDataSource(object sender, DataSourceEventArgs e)
    {
       XmlDataDocument xDoc = new XmlDataDocument();
       xDoc.DataSet.ReadXmlSchema(Server.MapPath("CustomerOrders.xml"));
       xDoc.Load(Server.MapPath("CustomerOrders.xml"));
    
       e.DataSource = xDoc.DataSet;
       WebCombo1.DataTextField = "CustomerID";
       WebCombo1.DataValueField = "CustomerID";
    }
    

  9. Run the project and the combo will look like following.

See Also