Intersoft WebGrid Documentation
Walkthrough: Displaying GroupTotal of child table
See Also Send comments on this topic.

Glossary Item Box

This walkthrough shows you how to display GroupTotal of ChildTable.

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 Application.

 Step-By-Step Instructions

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

    C# Copy Code
    if(!IsPostBack)
    {   
       // Prepare the Group Total    
       WebGrid1.GetTableByName("Order Details").GroupTotalVisible = true;    
       WebGrid1.GetTableByName("Order Details").Columns.GetNamedItem("Quantity").AggregateFunction = AggregateFunctions.Sum;     
       
       WebGridGroup groupByProductID = new WebGridGroup();    
       groupByProductID.Name = "GroupByProductID";    
       groupByProductID.ColumnMember = "ProductID";    
       WebGrid1.GetTableByName("Order Details").GroupedColumns.       
       Add(groupByProductID);
    }
    

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

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.