Intersoft WebGrid Documentation
Walkthrough: Binding a WebValueList to different DataSource control
See Also Send comments on this topic.

Glossary Item Box

This walkthrough shows you how to bind a WebValueList to different DataSource control.

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 Microsoft Access Northwind database.
  • Visual Studio 2005 Application.

 Step-By-Step Instructions

  1. Launch Visual Studio.NET 2005.
  2. Click on File menu, then select New and click Project.
  3. Select Visual C# Project in Project Types.
  4. Select ASP.NET Web Application in the Template box.
  5. Specify the Project's Location and click OK.
  6. Drag WebGrid instance into WebForm.
  7. Drag two AccessDataSource controls into WebForm.
  8. In Solution Explorer, right click on the project then click "Add New Item...".
  9. Add a DataSet and name it NorthWind to the project.



  10. Add Order_Details and Products table to the dataset.



  11. Open first AccessDataSource SmartTag and bind to Order_Details table.



  12. Open second AccessDataSource SmartTag and bind to Products table.



  13. Open WebGrid's SmartTag and set the DataSource to AccessDataSource1 then click OK to Retrieve WebGrid's structure.



  14. Open WebGrid.NET Designer - Advanced tab - RootTable - Columns. Search for ProductID.
  15. In ValueList Expandable panel, set the following properties:

    Property Value
    DataMember DefaultView
    DataSourceID AccesDataSource2
    DataTextField ProductName
    DataValueField ProductID



  16. Compile and run the WebForm. The WebGrid will look like following:


See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.