Intersoft WebGrid Documentation
Walkthrough: Using ExpandChildRow to expand child tables
See Also Send comments on this topic.

Glossary Item Box

This walkthrough shows you how to Expand Child table.

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

  1. Bind WebGrid to Hierarchical ISDataSource.
  2. In the InitializeRow event of the grid, expand the child rows.

    C# Copy Code
    using ISNet.WebUI.WebGrid;
    
    private void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
    {   
       // Only expands Customers' child table   
       if(e.Row.Type == RowType.Record && e.Row.Table.Name == "Customers")   
       {    
          e.Row.ExpandChildRow();   
       }
    }             
    

  3. Finally, the WebForm will look like the following snapshot:

     

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.