Intersoft WebGrid Documentation
Walkthrough: Binding a WebValueList to a table defined in ISDataSourceControl
See Also Send comments on this topic.

Glossary Item Box

This walkthrough shows you how to bind a WebValueList  to a table defined in ISDataSourceControl.

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/2008/2010 Application.

 Step-By-Step Instructions

To Bind DataSource in WebGrid at RunTime.

  1. Launch Visual Studio.NET 2008.
  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 ISDataSource control 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 tables to the dataset.



  11. Open ISDataSource SmartTag, click "Configure Data Source...".
  12. Choose NorthWind dataset as ISDataSource SchemaName.
  13. Click Next  and then add Order_Details and Products table to ISDataSource then Click Finish.



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



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

    Property Value
    DataMember Products
    DataSourceID ISDataSource1
    DataTextField ProductName
    DataValueField ProductID



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

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.