This example demonstrates how to obtain the records from the control's underlying data source for a particular cell. Double-click a cell to invoke a form that contains a grid to show the underlying data.
The data in this example are contained in the Northwind database in the SQL Server data file NW.mdf. The application can use the BindingSource component or the LinqServerModeDataSource instance to retrieve the data from the database. A LinqServerModeDataSource data source is a queryable data source, and it forces the PivotGrid to operate in server mode. Use the Server Mode toggle switch control to switch from one data source to another.
When you double-click the PivotGrid cell, the PivotGridControl.CellDoubleClick event occurs. The following CreateDrillDownDataSource method overrides are called to obtain the list of records associated with the selected cell:
- If Server Mode is not enabled, the e.CreateDrillDownDataSource(int maxRowCount) method returns a data source that contains the columns retrieved from the original data source as well as the columns which the PivotGrid creates.
- If Server Mode is enabled, the e.CreateDrillDownDataSource(int maxRowCount, List customColumns method returns a data source that contains the columns shown in the PivotGridControl and the columns explicitly specified in the method parameter.
You can also click the Get Grand Total Data button to call the PivotGridControl.CreateDrillDownDataSource method and display all data records that the PivotGridControl uses to show the summarized data.
Drill Down to the Underlying Data
- Pivot Grid for WinForms - How to Create the Underlying Data Source (Drill-Down) Asynchronously
- Pivot Grid for WPF - How to Display Underlying (Drill-Down) Records
(you will be redirected to DevExpress.com to submit your response)