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.
Note: 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.
Note: 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
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|
or the page will be automatically redirected to sign-in page in 10 seconds.