[DataGrid] [DataGridSample] Custom Aggregate for Number Columns

In order to customize an aggregate for a specific column we need to specify a function on OSCellRenderer for the given column. For our example we want our Amount column to be the division of Quantity by QuantityPlus.


As you see, when grouped by Part NO, the Quantity column sums to 15 as Quantity Plus sums to 115. We want our Amount column to be the division of these values. 


For that we created a customAggregate function that handles the calculation for our Amount column.

To make it work, we just need to call that function on OSCellRenderer property inside our Amount column.



Hope this helps you to improve your project, and can be used as a start for you to play with custom aggregates for your columns.