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
10258 Roland Mendel 7/17/2014 Austria Graz 7/23/2014 $2,011.00
10259 Francisco Chang 7/18/2014 Mexico México D.F. 7/25/2014 $101.00
10260 Henriette Pfalzheim 7/19/2014 Germany Köln 7/29/2014 $1,765.00
10261 Bernardo Batista 7/19/2014 Brazil Rio de Janeiro 7/30/2014 $440.00
10262 Paula Wilson 7/22/2014 USA Albuquerque 7/25/2014 $624.00
10263 Roland Mendel 7/23/2014 Austria Graz 7/31/2014 $2,500.00
10264 Maria Larsson 7/24/2014 Sweden Bräcke 8/23/2014 $725.00
10265 Frédérique Citeaux 7/25/2014 France Strasbourg 8/12/2014 $1,170.00
10266 Pirkko Koskitalo 7/26/2014 Finland Oulu 7/31/2014 $360.00
10267 Peter Franken 7/29/2014 Germany München 8/6/2014 $4,040.00
Data grid with 830 rows and 8 columns

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.