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

How to: Obtain Underlying Data (Drill-Down)

  • 3 minutes to read

The PivotGridControl supports the drill-down capability, which enables you to retrieve a list of records that can be used to calculate a particular summary. To obtain drill-down data, use the PivotGridControl‘s PivotCellBaseEventArgs.CreateDrillDownDataSource method. Its parameters completely identify a summary cell.

In this example, an end-user can view records from the control’s underlying data source, associated with a summary cell, by double-clicking it. The obtained data is displayed by the DXGrid within a popup window.

using DevExpress.Mvvm;
using DevExpress.Mvvm.DataAnnotations;
using DevExpress.Mvvm.POCO;
using DevExpress.Xpf.PivotGrid;
using HowtoObtainUnderlyingData.NwindDataSetTableAdapters;

namespace HowtoObtainUnderlyingData {
    [POCOViewModel]
    public class ViewModel {
        NwindDataSet.SalesPersonDataTable salesPersonDataTable = new NwindDataSet.SalesPersonDataTable();
        SalesPersonTableAdapter salesPersonDataAdapter = new SalesPersonTableAdapter();

        public NwindDataSet.SalesPersonDataTable DataSource { get { return salesPersonDataTable; } }

        protected ViewModel() {
            salesPersonDataAdapter.Fill(salesPersonDataTable);
        }

        public void ShowDrillDownData(CellInfo cellInfo) {
            this.GetService<IDialogService>().ShowDialog(MessageButton.OK, "Drill Down Results", cellInfo);
        }
    }
}