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