We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to calculate summaries for both minimum and maximum values of the Date field?

Platform: WinForms |
Control: GridGroupingControl |
Published Date: April 30, 2011 |
Last Revised Date: March 9, 2015
Tags: summaries, custom


There are no default summary types to find min/max values for a particular column. To find min/max values for a particular column, create a custom summary. To create a custom summary, refer to the following solution.


To create a custom summary, derive the SummaryBase class and then the Combine() method is used to get the new summary value by comparing it with other summary values. In the given sample, DateMaxSummary and DateMinSummary are the two sealed classes derived from the SummaryBase to find the min/max date summary values.

The following code example demonstrates how the Combine() method compares and gets the maximum date value.



C:\Users\ApoorvahR\Desktop\Note.pngNote: Similarly DateMinSummary is also derived from the SummaryBase class.

Use the following steps to create the date summary field.

Step 1: Create GridSummaryColumnDescriptor instance.



Step 2: Use the QueryCustomSummary event to instantiate the custom summary for maximum and minimum date.



C:\Users\ApoorvahR\Desktop\Note.pngNote: Hook the QueryCustomSummary event before adding the custom summary fields.

Step 3: Update the summary values.

Using the CurrentRecordContextChanged event, you can immediately update the summary values by invalidating the current record.



The following screenshot illustrates the min/max date summary in GridGroupingControl.

Figure 1: Min/Max Date Summary in GridGroupingControl

Sample Link



2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon