Skip to content

DevExpress-Examples/web-forms-pivot-grid-custom-summary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pivot Grid for WebForms - How to Implement Custom Summary

This example demonstrates different approaches to calculate a custom summary.

The task is to calculate the percentage of units that cost over $50 and show that value in the total columns.

CustomSummary Event

A custom summary is calculated for the "Unit Price" field. The field's SummaryType property is set to PivotSummaryType.Custom. The ASPxPivotGrid.CustomSummary event is handled to count the records whose total sum exceeds $50. The ratio of these records to all the records is assigned to the e.CustomValue parameter.

Unbound Expression

A field is an unbound field with an expression that calculates the ratio.

Data Binding API

In Optimized mode create a field bound to the ExpressionDataBinding object with the following expression:

ToDecimal(Sum(iif([Extended_Price]>=500,1,0)))/Count()

The resulting Pivot Grid is shown below:

Files to Review

Documentation

About

This example demonstrates different approaches to calculate a custom summary.

Topics

Resources

License

Stars

Watchers

Forks