How Do I Get Aggregate Values for Columns?

This lesson will show you how to add a custom property to a data grid that returns the aggregate value of a column. Usually this would be used with data grid tables but works equally as well with data grid forms.

Add a getProp To Your Data Grid Script

Add a getProp To Your Data Grid Script

The simplest way to calculate aggregate values is to add a getProp handler to your data grid script. In this example I've defined a custom property called uSumOfColumn (1). You can pass in a column name (2) and the sum of all rows of that column will be returned (3).

Using the Custom Property

Using the Custom Property

Here is an example of using the custom property. When clicking on the button (1) the text of another field is set to the uSumOfColumn custom property (2).

The Result

The Result

Here the result has been put into the "Sum" field.

0 Comments

Add your comment

E-Mail me when someone replies to this comment