New to Telerik UI for WPFStart a free 30-day trial

Drill Down

Updated on Sep 15, 2025

As of R1 2017, LocalDataSourceProvider exposes a GetUnderlyingData method that allows you to extract the records from your ItemsSource that were used for accumulating the result for a particular row and column. The GetUnderlyingData method takes two parameters: Row Group and Column Group.

Example 1: Calling GetUnderlyingData on Cell Double-Click

C#
	private void pivotGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
	{
		var pivotGrid = sender as RadPivotGrid;
		if (pivotGrid != null)
	    {
		    var cellData = (e.OriginalSource as FrameworkElement).DataContext as CellData;
		    if (cellData != null)
		    {
		        var cellAggregateValue = cellData.Data as CellAggregateValue;
		        var localProvider = pivotGrid.DataProvider as LocalDataSourceProvider;
				if (localProvider != null)
				{
		        	localProvider.GetUnderlyingData(cellAggregateValue.RowGroup, cellAggregateValue.ColumnGroup);
				}          
		    }
		}
	}

Example 1: Calling GetUnderlyingData on Cell Double-Click

VB.NET
	Private Sub pivotGrid_MouseDoubleClick(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
			Dim pivotGrid = TryCast(sender, RadPivotGrid)
			If pivotGrid IsNot Nothing Then
				Dim cellData = TryCast((TryCast(e.OriginalSource, FrameworkElement)).DataContext, CellData)
				If cellData IsNot Nothing Then
					Dim cellAggregateValue = TryCast(cellData.Data, CellAggregateValue)
					Dim localProvider = TryCast(pivotGrid.DataProvider, LocalDataSourceProvider)
					If localProvider IsNot Nothing Then
						localProvider.GetUnderlyingData(cellAggregateValue.RowGroup, cellAggregateValue.ColumnGroup)
					End If
				End If
			End If
	End Sub

Once RadPivotGrid has finished processing the underlying data, the newly-introduced GetUnderlyingDataCompleted event will be fired. Its DrillDownCompletedEventArgs have two properties:

  • Result: An IEnumerable representing the result of the underlying data extraction operation.
  • InnerExceptions: A read-only collection of any exceptions thrown during the underlying data extraction.

If the DeferUpdates property of the LocalDataSourceProvider is set to True, calling the GetUnderlyingData method without first updating the provider will result in an InvalidOperationException which will be passed to the DrillDownCompletedEventArgs' InnerExceptions collection.

he GetUnderlyingDataCompleted event is raised on multiple threads, so it is required to use Dispatcher when executing custom logic inside of the event handler.

Example 2: The GetUnderlyingDataCompleted Event Handler

C#
	private void dataProvider_GetUnderlyingDataCompleted(object sender, DrillDownCompletedEventArgs e)
    {
		Dispatcher.BeginInvoke(new Action(() => 
        {
		    if (e.InnerExceptions.Count() == 0)
		    {
		        this.underlyingDataGridView.ItemsSource = e.Result;
		    }
		    else
	        {
	            this.errorText = e.InnerExceptions.First().Message;
	        }
		}));
    }

A better example of the Drill Down functionality can be found in the WPF Controls Samples under PivotGrid -> Underlying data.

See Also

In this article
See Also
Not finding the help you need?
Contact Support