/
Form1.cs
38 lines (32 loc) · 1.42 KB
/
Form1.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
using DevExpress.XtraPivotGrid;
using System;
using System.Collections.Generic;
namespace XtraPivotGrid_CreateDrillDownDataSourceAsync {
public partial class Form1 : DevExpress.XtraEditors.XtraForm {
DrillDownForm dForm;
public Form1() {
InitializeComponent();
this.Load += Form1_Load;
pivotGridControl1.CellClick += pivotGridControl1_CellClick;
// This line of code is generated by Data Source Configuration Wizard
linqServerModeSource1.QueryableSource =
new XtraPivotGrid_CreateDrillDownDataSourceAsync.DataClasses1DataContext().Invoices;
}
async void pivotGridControl1_CellClick(object sender, PivotCellEventArgs e) {
PivotGridControl pivot = sender as PivotGridControl;
if (dForm.IsDisposed) LoadDrillDownForm();
//Check whether an asynchronous operation is in progress.
if (!pivot.IsAsyncInProgress)
// Get the record set associated with the clicked cell.
dForm.DataSource = await pivot.CreateDrillDownDataSourceAsync(e.ColumnIndex,
e.RowIndex, 25, new List<string> { "ProductName","Quantity" });
}
void Form1_Load(object sender, EventArgs e) {
LoadDrillDownForm();
}
void LoadDrillDownForm() {
dForm = new DrillDownForm();
dForm.Show();
}
}
}