This walkthrough shows you how to Expand Child table.
During this walkthrough, you will learn how to do the following :
- Bind WebGrid to Hierarchical mode.
- Use WebGrid's InitializeRow server side event to expand the child rows
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
- Bind WebGrid to Hierarchical ISDataSource.
- 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(); } }
- Finally, the WebForm will look like the following snapshot:
Tasks
How-to: Select a row from server side
References
InitializeRow Event
ExpandChildRow Method
Other Resources
Walkthrough Topics
How-to Topics