Drill Down
The XtraPivotGrid is designed to build summarized reports so that end-users can easily and quickly analyze large quantities of data. Features like filtering, top value display, hierarchical value arrangement on the axes, grand and group totals give you a wide range of tools to control the data's level of detail. The drill down capability included in the suite completes the massive arsenal in this toolset. With this feature you can easily take a look at the records that were used to calculate a particular summary.
Just a single line of code is required to obtain the records behind a summary. With just a few additional lines, you can show the obtained data in any suitable control, say for instance a DataGrid. The following code demonstrates how you can do this in the control's CellDoubleClick event handler.
|
private void pivotGridControl1_CellDoubleClick(object sender, DevExpress.XtraPivotGrid.PivotCellEventArgs e) { Form frm = new Form(); DataGrid grid = new DataGrid(); frm.Controls.Add(grid); grid.Dock = DockStyle.Fill; grid.DataSource = e.CreateDrillDownDataSource(); frm.ShowDialog(); frm.Dispose(); }
Private Sub pivotGridControl1_CellDoubleClick(ByVal sender As Object, _ ByVal e As DevExpress.XtraPivotGrid.PivotCellEventArgs) _ Handles pivotGridControl1.CellDoubleClick Dim Frm As Form = New Form() Dim Grid As DataGrid = New DataGrid() Grid.Parent = Frm Grid.Dock = DockStyle.Fill Grid.DataSource = e.CreateDrillDownDataSource(); Frm.ShowDialog() Frm.Dispose() End Sub
|
As you can see, the CellDoubleClick event is optimized for the drill down feature, since you can obtain the drill down data source directly via its parameter. You can also get that data source for an arbitrary cell. Simply obtain the cell information object via the control's Cells property and call that object's CreateDrillDownDataSource method.
The following image shows you how the drill down feature works. 
|