Intersoft WebGrid Documentation
Walkthrough: Binding WebGrid to ISLinqDataSource
See Also Send comments on this topic.

Glossary Item Box

This walkthrough will guide you to bind the WebGrid control to ISLinqDataSource.

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

 Prerequisites

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

  • Visual Studio 2005/2008/2010 Application.
  • Microsoft.NET Framework 3.5.
  • Intersoft WebUI Studio.NET 2009 R2 SP1.

 Step-By-Step Instructions

To create new web application and bind WebGrid to ISLinqDataSource

  1. Create new WebForm from Intersoft Default Form template.
  2. Open the toolbox. Expand Intersoft WebUI Studio.NET 2008 R2 tab group. Drag WebGrid to the designer surface.
  3. Drag ISLinqDataSource to the designer surface. If you can't find ISLinqDataSource, please download ISLinqDataSource and save the assembly to [Program Files]\Intersoft Solutions\WebGrid 6.0\Bin. Then add it to Visual Studio toolbox by right clicking on the toolbox area and click Choose Items.
  4. Click Configure Datasource from the ISLinqDataSource smart tag. See below.
  5. The LinqDataSource Wizard is pretty simple and straightforward. On the first screen, it should already select NorthwindDataContext by default, so simply click Next.
  6. On the second screen, since we want to select all customer properties, we don't need to configure anything else, simply click Finish. See below.



  7. Select WebGrid instance and open its smart tag. Choose ISLinqDataSource1 as the DataSourceID, and the WebGrid wizard will appear such as shown below.



  8. Simply click OK as we want the WebGrid to retrieve the columns structure from the ISLinqDataSource.
  9. You're all set. Save the WebForm, and run the page in the browser.
  10. You have successfully bound a WebGrid control to LINQ-enabled datasource. Your browser should look like the image below.

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.