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

PivotCellBaseEventArgs.CreateDrillDownDataSource() Method

Returns a list of records used to calculate a summary value for the cell currently being processed.

Namespace: DevExpress.Xpf.PivotGrid

Assembly: DevExpress.Xpf.PivotGrid.v18.2.dll

Declaration

public PivotDrillDownDataSource CreateDrillDownDataSource()

Returns

Type Description
PivotDrillDownDataSource

A PivotDrillDownDataSource object that contains records used to calculate a summary value for the current cell.

Remarks

The CreateDrillDownDataSource method allows you to retrieve the subset of records from the control’s underlying data source, used to calculate the summary value for the current cell.

Cells in the DXPivotGrid control display summary and total summary values. Each summary and total summary value is calculated for a specific subset of records in the control’s underlying data source. These records are identified by the values of the column and row fields displayed within the column and row headers.

Example

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