Intersoft WebGrid Documentation
How-to: Use avg aggregate in group header
See Also Send comments on this topic.

Glossary Item Box

With the new feature to display basic aggregate functions in group header, you can display the calculated values without has to enable the GroupTotal feature.

In this topic, you will learn how to configure avg aggregate in group header .

To configure avg aggregate in group header

  1. Bind WebGrid to AccessDataSource1 (Using Orders table from NorthWind data source).
  2. Bind WebGrid to AccessDataSource2 (Using Employees table from NorthWind data source).
  3. Open WebGrid.NET Designer - Advanced tab - RootTable.
  4. Group the Orders table based on EmployeeID column by expanding the RootTable and choose GroupColumns.
  5. Go to EmployeeID column and click See All Properties to set the GroupRowInfoFormat property to [value] - Total Orders: [count] items. Average Freight: [avg(Freight)].
  6. Go to EmployeeID column and Expand ValueList and set the following properties:
    Property Value
    DataSourceID AccessDataSource2
    DataTextField FirstName
    DataValueField EmployeeID
  7. As the result, the avg aggregate will look like following:
    AVGAggregate

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.