PivotCellEventArgs.CreateDrillDownDataSourceAsync(Int32, List<String>) Method
Returns data records used to calculate a summary value for the current cell asynchronously. Allows you to specify the columns and limit the number of records to return.
Namespace: DevExpress.XtraPivotGrid
Assembly: DevExpress.XtraPivotGrid.v24.2.dll
Declaration
public Task<PivotDrillDownDataSource> CreateDrillDownDataSourceAsync(
int maxRowCount,
List<string> customColumns
)
Parameters
Name | Type | Description |
---|---|---|
maxRowCount | Int32 | An integer value that specifies the maximum number of data rows to return. Set it to -1 to retrieve all rows. |
customColumns | List<String> | A list of columns to return. |
Returns
Type | Description |
---|---|
Task<PivotDrillDownDataSource> | An asynchronous operation that returns PivotDrillDownDataSource. |
Remarks
Cells in the Pivot Grid 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.
The CreateDrillDownDataSourceAsync
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.
In Server and OLAP modes, the CreateDrillDownDataSourceAsync
method returns only visible fields. To get hidden field values, use the method’s overloads with the customColumns
parameter that allows you to specify the columns to return.
Example
The code snippet below shows how to create a drill-down data source for the selected Pivot Grid cell and how to display the resulting data source in the DrillDownForm
dialog.
using DevExpress.XtraEditors;
using DevExpress.XtraPivotGrid;
using System;
using System.Windows.Forms;
namespace DxSampleOLAP {
public partial class OLAPDrillDownUserControl : XtraUserControl {
public OLAPDrillDownUserControl() {
InitializeComponent();
pivotGridControl.OptionsBehavior.UseAsyncMode = true;
// ...
pivotGridControl.CellDoubleClick += async (s, e) => {
try {
pivotGridControl.LoadingPanelVisible = true;
PivotDrillDownDataSource ds = await e.CreateDrillDownDataSourceAsync();
pivotGridControl.LoadingPanelVisible = false;
using(DrillDownForm form = new DrillDownForm(ds))
form.ShowDialog();
} catch(Exception ex) {
pivotGridControl.LoadingPanelVisible = false;
XtraMessageBox.Show(ex.Message);
}
};
}
}
}