This repository has been archived by the owner on Oct 16, 2023. It is now read-only.
/
Form1.cs
59 lines (52 loc) · 2.19 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace PivotGridDrillDownDataExample
{
public partial class Form1 : XtraForm
{
public Form1()
{
InitializeComponent();
pivotGridControl1.BestFit();
repositoryItemPopupContainerEdit1.QueryPopUp += repositoryItemPopupContainerEdit1_QueryPopUp;
repositoryItemPopupContainerEdit1.CloseUp += repositoryItemPopupContainerEdit1_CloseUp;
repositoryItemPopupContainerEdit1.PopupControl = CreatePopupControl();
}
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'nwindDataSet.SalesPerson' table. You can move, or remove it, as needed.
this.salesPersonTableAdapter.Fill(this.nwindDataSet.SalesPerson);
}
private PopupContainerControl CreatePopupControl()
{
PopupContainerControl result = new PopupContainerControl();
DrillDownControl ddc = new DrillDownControl();
ddc.Name = "DrillDownControl";
ddc.Dock = DockStyle.Fill;
result.Size = ddc.Size;
result.Controls.Add(ddc);
return result;
}
private void repositoryItemPopupContainerEdit1_QueryPopUp(object sender, CancelEventArgs e)
{
PopupContainerEdit editor = (PopupContainerEdit)sender;
DrillDownControl ddc =
(DrillDownControl)editor.Properties.PopupControl.Controls["DrillDownControl"];
ddc.DataSource = pivotGridControl1.Cells.GetFocusedCellInfo().CreateDrillDownDataSource();
}
private void repositoryItemPopupContainerEdit1_CloseUp(object sender, CloseUpEventArgs e)
{
PopupContainerEdit editor = (PopupContainerEdit)sender;
DrillDownControl ddc =
(DrillDownControl)editor.Properties.PopupControl.Controls["DrillDownControl"];
if (ddc.DataSource != null)
{
((IDisposable)ddc.DataSource).Dispose();
ddc.DataSource = null;
}
}
}
}