[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Expand]Grid View
  [Collapse]Tree List
   [Expand]Product Information
    [Expand]Binding to Data
    [Expand]Data Representation Basics
    [Expand]Data Editing
    [Collapse]Data Shaping and Manipulation
     [Collapse]Data Summaries
       Built-In Aggregate Functions
       Custom Aggregate Functions
     Drag and Drop
    [Expand]Focus and Navigation
     Appearance Customization
     Save and Restore Layout
   [Expand]Visual Elements
   [Expand]Member Tables
  [Expand]Card View
  [Expand]Chart Control
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Controls
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Custom Aggregate Functions

The ASPxTreeList enables you to manually implement custom aggregate functions or calculate summary values using a custom algorithm. Custom summaries allow you the following:

  • Calculate summaries against nodes that meet specific criteria;
  • Involve multiple data fields in calculations;
  • Implement complex summary functions.

To manually calculate summaries, you should set the summary item's TreeListSummaryItem.SummaryType property to 'Custom' and handle the ASPxTreeList.CustomSummaryCalculate event.

Expanded Example

This example shows how to implement a custom summary calculation.

Create a summary item within the ASPxTreeList.Summary collection and customize its settings as shown below:

The ASPxTreeList.CustomSummaryCalculate event is handled to sum the budgets of selected departments. Finally, set the TreeListSettingsBehavior.ProcessSelectionChangedOnServer option to true.

The image below shows the result:

Is this topic helpful?​​​​​​​