WebGrid is able to show column footer total which is fixed and non-scrolled as users scroll the table's content. The column footer total shows the summary information of all rows, regardless of grouped rows.
In this topic, you will learn how to enable Group Footer total.
To enable Group Footer
- Bind WebGrid to AccessDataSource (Using Invoices table from NorthWind data source).
- Right click on WebGrid and choose WebGrid.NET Designer.
- Click See all properties. Set GroupByBoxVisible to True.
- Switch to Advanced tab. Expand RootTable and select GroupColumns.
- Add two columns. The first column, set ColumnMember to CustomerID, SortOrder to Ascending. The second one, set ColumnMember to ProductName, SortOrder to Ascending.
- Go to Columns. Select UnitPrice and set AggregateFunction to Avg and FooterText to "Avg:".
- Select Quantity and set AggregateFunction to Sum and FooterText to "Sum:".
- Select Discount and set AggregateFunction to Max and FooterText to "Max:".
- Run the project.
Other Resources
Walkthrough Topics
How-to Topics