-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml.cs
41 lines (39 loc) · 1.52 KB
/
MainWindow.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using DevExpress.Xpf.Core;
using DevExpress.Xpf.PivotGrid;
using System.Collections.ObjectModel;
using System.Windows;
namespace WpfDrillDownDataSourceExample
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
///
public partial class MainWindow : ThemedWindow
{
public ObservableCollection<MyOrderRow> OrderSourceList { get; set; }
public ObservableCollection<MyOrderRow> OrderDrillDownList { get; set; }
public MainWindow()
{
InitializeComponent();
OrderSourceList = DatabaseHelper.CreateData();
pivotGridControl1.DataSource = OrderSourceList;
}
private void PivotGridControl1_CellSelectionChanged(object sender, RoutedEventArgs e)
{
OrderDrillDownList = new ObservableCollection<MyOrderRow>();
foreach (System.Drawing.Point cellPoint in pivotGridControl1.MultiSelection.SelectedCells)
{
foreach (PivotDrillDownDataRow record in pivotGridControl1.GetCellInfo(cellPoint.X, cellPoint.Y).CreateDrillDownDataSource())
{
OrderDrillDownList.Add(OrderSourceList[record.ListSourceRowIndex]);
}
}
lvOrders.ItemsSource = OrderDrillDownList;
}
private void ThemedWindow_Loaded(object sender, RoutedEventArgs e)
{
pivotGridControl1.BestFitArea = DevExpress.Xpf.PivotGrid.FieldBestFitArea.FieldHeader;
pivotGridControl1.BestFit();
}
}
}