PivotDrillDownDataSource Class

Represents a list of the records which are used to calculate summaries for individual cells.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.PivotGrid.v19.2.Core.dll


public abstract class PivotDrillDownDataSource :
Public MustInherit Class PivotDrillDownDataSource
    Inherits PivotDataSource


The PivotDrillDownDataSource object is returned by the CreateDrillDownDataSource method, provided by the PivotGrid control. The method overloads allow you to obtain a list of the records which are used to calculate summaries for individual cells.

The PivotDrillDownDataSource class implements the IList interface, so the data returned by the CreateDrillDownDataSource method can easily be displayed in a grid control (XtraGrid or DataGrid).

Use the PivotGridControl.CreateDrillDownDataSource method to access the underlying data for a cell. In addition, the CreateDrillDownDataSource method is accessible:

Individual rows in the PivotDrillDownDataSource are represented by PivotDrillDownDataRow objects.

Use the CreateDrillDownDataSource method to retrieve the underlying data in OLAP mode.


The following example shows how to display the records from the control's underlying data source which correspond to a particular cell. A new form that displays these records is opened when a particular cell in the PivotGrid control is double-clicked.

In the example the PivotGridControl.CellDoubleClick event is handled. The PivotCellEventArgsBase<TField, TData, TCustomTotal>.CreateDrillDownDataSource method is called to obtain the list of records associated with the clicked cell.

The following image shows a sample PivotGrid control which is bound to the Invoices table in the nwind.mdb database:


Clicking the third cell in the 1994 column will invoke the following form:


It lists all the orders made in 1994 by Belgian customers.

using DevExpress.XtraPivotGrid;

private void pivotGridControl1_CellDoubleClick(object sender, PivotCellEventArgs e) {
   // Create a new form.
   Form form = new Form();
   form.Text = "Records";
   // Place a DataGrid control on the form.
   DataGrid grid = new DataGrid();
   grid.Parent = form;
   grid.Dock = DockStyle.Fill;
   // Get the recrd set associated with the current cell and bind it to the grid.
   grid.DataSource = e.CreateDrillDownDataSource();
   form.Bounds = new Rectangle(100, 100, 500, 400);
   // Display the form.


See Also