# Create custom aggregate functions

## DESCRIPTION

Create custom aggregate functions for the page data, and differentiate between columns, total footers and group footers.

## SOLUTION

To implement custom footer aggregates, you need the following:

1. set the **Aggregate** of the **column** to **Custom**
2. handle the \*\*CustomAggregate event \*\*of the grid
3. check the **item type** that fired the event (**GridGroupFooterItem** or **GridFooterItem**)
4. check the column that fired the event
5. loop through the **corresponding grid items collection** to implement the desired aggregate (**all grid items** for the **total footer** and the **child items** from the corresponding **header** for the **group footer**)

You can find an example attached below.

* [DOWNLOAD Sample](https://www.telerik.com/products/aspnet-ajax/documentation/assets/144fd478a18fe533f89f0730c8fa8937/grid-custom-aggregate-example.zip)
