Custom Summary

 
Order ID Customer Order Date Ship Country Ship City Shipped Date Total
10248 Paul Henriot 7/4/2014 France Reims 7/16/2014 $443.00
10249 Karin Josephs 7/5/2014 Germany Münster 7/10/2014 $1,851.00
10250 Mario Pontes 7/8/2014 Brazil Rio de Janeiro 7/12/2014 $1,805.00
10251 Mary Saveley 7/8/2014 France Lyon 7/15/2014 $682.00
10252 Pascale Cartrain 7/9/2014 Belgium Charleroi 7/11/2014 $3,730.00
10253 Mario Pontes 7/10/2014 Brazil Rio de Janeiro 7/16/2014 $1,428.00
10254 Yang Wang 7/11/2014 Switzerland Bern 7/23/2014 $627.00
10255 Michael Holz 7/12/2014 Switzerland Genève 7/15/2014 $2,485.00
10256 Paula Parente 7/15/2014 Brazil Resende 7/17/2014 $510.00
10257 Carlos Hernández 7/16/2014 Venezuela San Cristóbal 7/22/2014 $1,109.00
of 83

Our Blazor Grid allows you to compute total and group summaries based on custom logic. To create a custom summary, declare a DxGridSummaryItem object in the TotalSummary or GroupSummary template and set the SummaryType property to Custom. Then, handle the Grid's CustomSummary event to implement the summary calculation algorithm. This event occurs multiple times as follows:

  • Before grid rows are processed. The event argument's SummaryStage property value is Start. At this stage, you can initialize a summary value.
  • For each data row in the processed range. The SummaryStage property value is Calculate. At this stage, you can calculate a summary value.
  • After grid rows are processed. The SummaryStage property value is Finalize. At this stage, you can finalize summary calculation.

To refresh grid summary values, call the RefreshSummary method. You can also specify the DisplayText property or handle the CustomizeSummaryDisplayText event to customize the summary's display text.

In this demo, the custom summary calculates the sum of Total values against the selected Grid rows. The built-in total summary calculates the grand total for all rows.