Class
LocalDataSourceProvider

Provides pivot grouping and aggregation operations for local data sources such as IList collections and user-defined class instances. This data provider enables in-memory pivot operations with support for property-based grouping, filtering, aggregation, and drill-down functionality.

Definition

Namespace:Telerik.Pivot.Core

Assembly:Telerik.WinControls.PivotGrid.dll

Syntax:

cs-api-definition
public class LocalDataSourceProvider : DataProviderBase, IDataProvider, INotifyPropertyChanged, ISupportInitialize, IUnderlyingDataProvider

Inheritance: objectDataProviderBaseLocalDataSourceProvider

Implements: IDataProviderINotifyPropertyChangedISupportInitializeIUnderlyingDataProvider

Inherited Members DataProviderBase.BeginInit()DataProviderBase.EndInit()DataProviderBase.Refresh()DataProviderBase.DeferRefresh()DataProviderBase.Invalidate()DataProviderBase.OnStatusChanged(DataProviderStatusChangedEventArgs)DataProviderBase.OnPrepareDescriptionForField(PrepareDescriptionForFieldEventArgs)DataProviderBase.OnFieldDescriptionsProviderChanged(IFieldDescriptionProvider, IFieldDescriptionProvider)DataProviderBase.OnPropertyChanged(string)DataProviderBase.GetAggregateDescriptionForFieldDescription(IPivotFieldInfo)DataProviderBase.GetGroupDescriptionForFieldDescription(IPivotFieldInfo)DataProviderBase.GetFilterDescriptionForFieldDescription(IPivotFieldInfo)DataProviderBase.FieldInfosDataProviderBase.DeferUpdatesDataProviderBase.StatusDataProviderBase.AggregatesPositionDataProviderBase.AggregatesLevelDataProviderBase.FieldDescriptionsProviderDataProviderBase.HasPendingChangesDataProviderBase.SettingsDataProviderBase.StatusChangedDataProviderBase.PropertyChangedDataProviderBase.PrepareDescriptionForField

Constructors

LocalDataSourceProvider()

Initializes a new instance of the LocalDataSourceProvider class with default pivot engine. Sets up the provider for processing local data sources with in-memory pivot operations and drill-down support.

Declaration

cs-api-definition
public LocalDataSourceProvider()

Properties

AggregateDescriptions

Gets a collection of LocalAggregateDescription objects that specify how data should be aggregated within the intersection of row and column groups. These define the calculated values displayed in pivot cells using various aggregate functions like Sum, Count, Average, etc.

Declaration

cs-api-definition
public Collection<LocalAggregateDescription> AggregateDescriptions { get; }

Property Value

Collection<LocalAggregateDescription>

CalculatedFields

Gets a collection of CalculatedField objects that define calculated aggregate values. Calculated fields allow creating custom expressions and formulas that can be used as aggregate values in the pivot, providing advanced computation capabilities beyond standard aggregate functions.

Declaration

cs-api-definition
public Collection<CalculatedField> CalculatedFields { get; }

Property Value

Collection<CalculatedField>

ColumnGroupDescriptions

Gets a collection of PropertyGroupDescriptionBase objects that specify how the pivot data should be grouped by columns. Column groupings create the hierarchical structure displayed at the top of the pivot grid using object properties.

Declaration

cs-api-definition
public Collection<PropertyGroupDescriptionBase> ColumnGroupDescriptions { get; }

Property Value

Collection<PropertyGroupDescriptionBase>

Culture

Gets or sets the CultureInfo used for grouping, formatting, and sorting operations. This culture affects how data is grouped, displayed, and compared in different locales.

Declaration

cs-api-definition
public CultureInfo Culture { get; set; }

Property Value

CultureInfo

EnableHierarchy

Gets or sets a value indicating whether nested properties of objects in the ItemsSource should be displayed in a hierarchical structure. When enabled, complex object properties are shown as expandable tree nodes in the field list.

Declaration

cs-api-definition
public bool EnableHierarchy { get; set; }

Property Value

bool

FilterDescriptions

Gets a collection of PropertyFilterDescriptionBase objects that specify how pivot items should be filtered. Filters are applied to restrict which data items are included in pivot calculations and display.

Declaration

cs-api-definition
public Collection<PropertyFilterDescriptionBase> FilterDescriptions { get; }

Property Value

Collection<PropertyFilterDescriptionBase>

ItemsSource

Gets or sets the data source for pivot operations. This can be any IEnumerable collection such as IList, Array, ObservableCollection, or other enumerable data sources containing the objects to be analyzed and grouped in the pivot.

Declaration

cs-api-definition
public object ItemsSource { get; set; }

Property Value

object

Results

Gets the current pivot calculation results containing the processed data from the local data source. This property provides access to the aggregated and grouped data ready for display in pivot controls.

Declaration

cs-api-definition
protected override IPivotResults Results { get; }

Property Value

IPivotResults

Overrides DataProviderBase.Results

RowGroupDescriptions

Gets a collection of PropertyGroupDescriptionBase objects that specify how the pivot data should be grouped by rows. Row groupings create the hierarchical structure displayed on the left side of the pivot grid using object properties.

Declaration

cs-api-definition
public Collection<PropertyGroupDescriptionBase> RowGroupDescriptions { get; }

Property Value

Collection<PropertyGroupDescriptionBase>

State

Gets the current state object representing the items source for this data provider. This state is used for field description retrieval and data source management.

Declaration

cs-api-definition
public override object State { get; }

Property Value

object

The ItemsSource object representing the current provider state.

Overrides DataProviderBase.State

Methods

BlockUntilRefreshCompletes()

Blocks the calling thread until the current refresh operation completes. For local data source provider, this waits for the parallel processing engine to complete all operations.

Declaration

cs-api-definition
public override void BlockUntilRefreshCompletes()

Overrides DataProviderBase.BlockUntilRefreshCompletes()

CreateFieldDescriptionsProvider()

Creates a field description provider for retrieving metadata and field information from the local data source. This provider analyzes object properties to discover available fields for pivot operations.

Declaration

cs-api-definition
protected override IFieldDescriptionProvider CreateFieldDescriptionsProvider()

Returns

IFieldDescriptionProvider

A new LocalDataSourceFieldDescriptionsProvider instance for analyzing the local data source.

Overrides DataProviderBase.CreateFieldDescriptionsProvider()

GetAggregateDescriptionForFieldDescriptionCore(IPivotFieldInfo)

Creates an aggregate description for the specified field that can be used in local data source pivot operations. The description is configured based on the field type, using appropriate aggregate functions for numeric vs non-numeric data.

Declaration

cs-api-definition
protected override IAggregateDescription GetAggregateDescriptionForFieldDescriptionCore(IPivotFieldInfo description)

Parameters

description

IPivotFieldInfo

The pivot field information to create an aggregate description for.

Returns

IAggregateDescription

A LocalAggregateDescription configured for the specified field.

Exceptions

ArgumentNullException

Thrown when description is null.

Overrides DataProviderBase.GetAggregateDescriptionForFieldDescriptionCore(IPivotFieldInfo)

GetFilterDescriptionForFieldDescriptionCore(IPivotFieldInfo)

Creates a filter description for the specified field that can be used in local data source filtering operations. The description is configured with the field name for property-based filtering.

Declaration

cs-api-definition
protected override FilterDescription GetFilterDescriptionForFieldDescriptionCore(IPivotFieldInfo description)

Parameters

description

IPivotFieldInfo

The pivot field information to create a filter description for.

Returns

FilterDescription

A PropertyFilterDescription configured for the specified field.

Exceptions

ArgumentNullException

Thrown when description is null.

Overrides DataProviderBase.GetFilterDescriptionForFieldDescriptionCore(IPivotFieldInfo)

GetGroupDescriptionForFieldDescriptionCore(IPivotFieldInfo)

Creates a group description for the specified field that can be used in local data source pivot grouping operations. The description type is chosen based on the field data type, supporting numeric ranges, date/time steps, and property grouping.

Declaration

cs-api-definition
protected override IGroupDescription GetGroupDescriptionForFieldDescriptionCore(IPivotFieldInfo description)

Parameters

description

IPivotFieldInfo

The pivot field information to create a group description for.

Returns

IGroupDescription

A PropertyGroupDescriptionBase configured for the specified field type.

Exceptions

ArgumentNullException

Thrown when description is null.

Overrides DataProviderBase.GetGroupDescriptionForFieldDescriptionCore(IPivotFieldInfo)

GetUnderlyingData(IGroup, IGroup)

Extracts the underlying data items for the specified row and column group intersection. This method provides drill-down functionality to access the detailed data behind pivot aggregates.

Declaration

cs-api-definition
public void GetUnderlyingData(IGroup rowGroup, IGroup columnGroup)

Parameters

rowGroup

IGroup

The row group to drill down into, or null for all rows.

columnGroup

IGroup

The column group to drill down into, or null for all columns.

Implements IUnderlyingDataProvider.GetUnderlyingData(IGroup, IGroup)

RefreshOverride()

Performs the core refresh operation by processing the local data source, initializing descriptions, and executing pivot calculations. This method handles field initialization and pivot engine execution.

Declaration

cs-api-definition
protected override void RefreshOverride()

Overrides DataProviderBase.RefreshOverride()

Events

GetUnderlyingDataCompleted

Occurs when the underlying data extraction for drill-down operations is completed. This event provides access to the detailed data behind specific pivot intersections.

Declaration

cs-api-definition
public event EventHandler<DrillDownCompletedEventArgs> GetUnderlyingDataCompleted

Event Value

EventHandler<DrillDownCompletedEventArgs>

Implements IUnderlyingDataProvider.GetUnderlyingDataCompleted