Skip to main content
A newer version of this page is available. .

Legacy and LegacyOptimized Calculation Engines

  • 4 minutes to read

Legacy is the originally developed data engine. Demonstrates acceptable performance if a data-source contains less than 100,000 rows. The engine is not optimized for summary and aggregate calculations. Best suited for a dozen of fields in the row area that contains mostly unique values.

The LegacyOptimized engine is available from v17.1. The engine supports the Legacy engine’s features, inherited from legacy API, and increases data processing speed (up to 30 times faster). From v17.2, the Pivot Grid’s LegacyOptimized mode can utilize multi-core processors for data operations. The control splits bound records into bulks and processes them in parallel threads. Data processing speed increases proportional to the number of CPU cores. Allows you to restore a layout configured in Legacy mode. From v18.2, LegacyOptimized is a default engine.

To switch to the LegacyOptimized engine, set the PivotGridOptionsData.DataProcessingEngine property to DataProcessingEngine.LegacyOptimized:

pivotGridControl1.OptionsData.DataProcessingEngine = PivotDataProcessingEngine.LegacyOptimized;

Data Binding

The Legacy and Legacy-optimized modes support bound and unbound fields:

  • Bound fields retrieve data from the pivot grid’s underlying data source.
  • Unbound fields get data by evaluating an expression or handling an event. You can use unbound fields to construct and display user-friendly values in field headers. You can sort, group, and filter unbound fields like bound fields.

Data Processing

The LegacyOptimized and Legacy modes use API that is not supported in Optimized mode.

LegacyOptimized performs different data-related features in the following cases:

  1. Data Sorting and Grouping.

    The Legacy engine aggregates data after sorting at data source level. The Pivot Grid raises the CustomFieldSort event to compare different data rows and calls the CustomGroupInterval event for each data source row.

    The LegacyOptimized engine sorts aggregated data. The LegacyOptimized engine raises the CustomFieldSort event to compare the resulting data groups and the CustomGroupInterval event for unique field values only.

  2. The default summary values specified by the SummaryType property are calculated without converting values.

    The Legacy engine converts all values to decimal and calculates summary values.

    In Legacy-optimized mode, the PivotGridFieldBase.SummaryType property specifies the default summary values and the Legacy-optimized engine performs calculations without converting values.

  3. Calculated Fields are processed for fields with incorrect FieldName values.

    The Legacy engine checks calculated fields’ FieldName and UnboundFieldName property values before processing. If names match the name of any data source column, the field is ‘bound’ and data is loaded from the data source. The LegacyOptimized engine does not verify field names and calculates all fields with any UnboundType property value except for Bound.

  4. The IEnumerable.GetEnumerator method is used to read data source data.

    The Legacy engine uses the IList.Item[Int32] property to read all data. The new LegacyOptimized engine uses the IList.Item[Int32] property to get values from specific data source rows, and uses the IEnumerable.GetEnumerator method to read data from the entire data source to improve performance.

  5. UnboundExpressions are compiled before processing.

    The Legacy engine processes UnboundExpressions for each row in the data source and can parse a String values to get DateTime or numbers.

    The LegacyOptimized engine compiles the UnboundExpression once before data is processed. This approach provides faster processing, but has restrictions for the type of provided data. For example, you need to use ToDateTime, ToInt, ToDouble, and ToDecimal functions to parse string values.



The Legacy and LegacyOptimized modes do not support Data Binding API.

You cannot use the control’s CreateDrillDownDataSource methods to request underlying data in the following events:

PivotGridControl.CustomSummary[1] PivotGridControl.CustomSummary[1] ASPxPivotGrid.CustomSummary[1]
PivotGridControl.CustomFieldSort PivotGridControl.CustomFieldSort ASPxPivotGrid.CustomFieldSort
PivotGridControl.CustomUnboundFieldData PivotGridControl.CustomUnboundFieldData ASPxPivotGrid.CustomUnboundFieldData
PivotGridControl.CustomGroupInterval PivotGridControl.CustomGroupInterval ASPxPivotGrid.CustomGroupInterval

When you handle the listed events, the Pivot Grid calculates data.

  1. Call the PivotCustomSummaryEventArgs.CreateDrillDownDataSource() method to get the underlying data when you handle the CustomSummary event.