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

Drill Down

Updated on Dec 10, 2025

The 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.

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);
				}          
		    }
		}
	}

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.

The 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