This walkthrough shows you how to implement LoadOnDemand in Hierarchical table.
During this walkthrough, you will learn how to do the following:
- Use ISDataSource control.
- Use WebGrid and ISDataSource SmartTag.
- Implement LoadOnDemand.
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 create new web application and set LoadOnDemand using ISDataSource properties
- Bind WebGrid to ISDataSource.
- Add Query by double click on dsNorthWind.xsd in App_Code then right click on the Orders.
- In TableAdapter Query Configuration Wizard, choose Use SQL Statements, click Next.
- Then choose Select which returns rows, click Next.
- Specify this query "SELECT CustomerID, EmployeeID, Freight, OrderDate, OrderID, RequiredDate, ShipAddress, ShipCity, ShipCountry, ShipName, ShipPostalCode, ShipRegion, ShipVia, ShippedDate FROM Orders WHERE (CustomerID = ?)" then click Next.
- Set Fill a DataTable method name to FillBy and Return a DataTable method name to GetDataBy.
- Click Next - Finish.
-
Set ISDataSource properties.
Property Value LoadOnDemand True EnableCaching Yes
-
Open ISDataSource Designer
Property Value SelectChildRowMethod GetDataBy
Other Resources
Walkthrough Topics
How-to Topics