WebGrid provides built-in column aggregation feature.
This topic will show you how to use column aggregation.
To use column aggregation
- Bind WebGrid to Products table.
- Right-click on WebGrid control and choose WebGrid.NET Designer.
- Switch to Advanced tab and go to RootTable.
- Set ColumnFooters to Yes.
- Expand RootTable and select Columns.
- In UnitPrice column, set AggregateFunction property to Max and FooterText property to "MaxPrice : ".
- In UnitInStock column, set AggregateFunction property to Sum and FooterText property to "Sum : ".
- In UnitOnOrder column, set AggregateFunction property to Avg and FooterText property to "Average : ".
- Run the project.
Other Resources
Walkthrough Topics
How-to Topics