[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Collapse]Tree List
   [Expand]Product Information
   [Collapse]Feature Center
    [Expand]Data Binding
    [Expand]Data Editing
    [Expand]Data Presentation
      Summary Types
      Total Summaries
      Group Summaries
      Custom Summaries
      Formatting Summary Values
    [Expand]Appearances and Look And Feel
    [Expand]Focus, Selection and Navigation
     Formatting Cell Values
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]End User Capabilities
   [Expand]Member Tables
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[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]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Custom Summaries

Expanded Custom Summaries

The Tree List provides a TreeList.GetCustomSummaryValue event which enables you to implement custom aggregate functions. For instance, you may want to calculate the number of nodes which have column values below a certain level. Another example is calculating a discount from the maximum value. In such cases, you should write a GetCustomSummaryValue event handler.

If you want to calculate the footer summary or group summary in a custom way, set the TreeListColumn.SummaryFooter or TreeListColumn.RowFooterSummary property to SummaryItemType.Custom. Otherwise the TreeList.GetCustomSummaryValue event will not fire.

The event's parameter provides the following properties that can be used to calculate the resulting summary value.

Expanded Example

The following example calculates the number of records for which the "Budget" column's value exceeds 500,000. The setCustomSummary method sets the custom summary type for the Budget column. The TreeList.GetCustomSummaryValue event handler implements the calculation logic.

The image below shows the result.

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