Skip to content

This example demonstrates how to obtain the records from the control's underlying data source for a selected cell or multiple selected cells.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/wpf-pivotgrid-how-to-display-underlying-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pivot Grid for WPF - How to Display Underlying Records

This example demonstrates how to obtain records from the control's underlying data source for a selected cell or multiple selected cells.

  • Click a cell to show the underlying data in the GridControl.
  • Select multiple cells to show the order IDs of the orders summarized in the selected cells. Order IDs are displayed as buttons in the ItemsControl control.

The PivotGridControl.CellClick event is handled in XAML with the DXEvent DevExpress MVVM framework extension. When the cell is clicked, the CreateDrillDownDataSource method returns the PivotDrillDownDataSource instance that contains underlying data for the current cell. The PivotDrillDownDataSource object is used as the GridControl's data source (it is assigned to the GridControl.ItemsSource property.)

The PivotGridControl.CellSelectionChanged event is handled in the code-behind. The coordinates of the selected cells are obtained with the PivotGridControl.MultiSelection.SelectedCells notation. For each (X, Y) pair of cell coordinates, the PivotGridControl.GetCellInfo method returns an object whose CreateDrillDownDataSource method yields the PivotDrillDownDataSource object. The PivotDrillDownDataSource exposes an enumerator and supports an iteration over a collection of PivotDrillDownDataRow objects. The PivotDrillDownDataRow.ListSourceRowIndex property value is an index of the record in the original data source, so the source record is also available and can be added to a collection. The resulting collection is bound to ItemsControl for display.

Files to Review

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

This example demonstrates how to obtain the records from the control's underlying data source for a selected cell or multiple selected cells.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 7