-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
103 lines (100 loc) · 4.82 KB
/
MainWindow.xaml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<dx:ThemedWindow
x:Class="WpfPivotCustomFilterDropDownExample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxfui="http://schemas.devexpress.com/winfx/2008/xaml/core/filteringui"
xmlns:dxpg="http://schemas.devexpress.com/winfx/2008/xaml/pivotgrid"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Width="800"
Height="450"
mc:Ignorable="d"
Loaded="ThemedWindow_Loaded"
Title="Custom Filter Drop Down">
<Window.Resources>
<dx:ExcelItemsSource
x:Key="ExcelItemsSource"
FileUri="pack://application:,,,/WpfPivotCustomFilterDropDownExample;component/Data/SalesPerson.xlsx"
StreamDocumentFormat="Xlsx"
WorksheetName="Data">
<dx:ExcelItemsSource.Columns>
<dx:ExcelColumn ColumnType="{x:Type sys:String}" Name="CategoryName" />
<dx:ExcelColumn ColumnType="{x:Type sys:String}" Name="Country" />
<dx:ExcelColumn ColumnType="{x:Type sys:String}" Name="ProductName" />
<dx:ExcelColumn ColumnType="{x:Type sys:String}" Name="Sales Person" />
<dx:ExcelColumn ColumnType="{x:Type sys:DateTime}" Name="OrderDate" />
<dx:ExcelColumn
ColumnType="{x:Type sys:Double}"
IsSelected="False"
Name="OrderID" />
<dx:ExcelColumn ColumnType="{x:Type sys:Double}" Name="Quantity" />
<dx:ExcelColumn ColumnType="{x:Type sys:Double}" Name="Discount" />
<dx:ExcelColumn ColumnType="{x:Type sys:Double}" Name="Extended Price" />
<dx:ExcelColumn ColumnType="{x:Type sys:Double}" Name="UnitPrice" />
</dx:ExcelItemsSource.Columns>
</dx:ExcelItemsSource>
</Window.Resources>
<Grid>
<dxpg:PivotGridControl DataSource="{Binding Path=Data, Source={StaticResource ExcelItemsSource}}"
Name="pivotGridControl1"
FieldFilterPopupMode="Excel"
ShowOnlyAvailableFilterItems="True">
<dxpg:PivotGridControl.Fields>
<dxpg:PivotGridField
Area="DataArea"
Caption="Product Sales"
FieldName="Extended Price"
Name="fieldSales" />
<dxpg:PivotGridField
Area="FilterArea"
Caption="OrderDate"
FieldName="OrderDate"
GroupInterval="Date"
Name="fieldOrderDate"
ImmediateUpdateExcelStyleFilter="False">
<dxpg:PivotGridField.CustomExcelStyleFilterPopupTemplate>
<DataTemplate>
<dxfui:ExcelStyleFilterElement Name="PART_FilterElement" QueryOperators="OnExcelStyleFilterQueryOperators"/>
</DataTemplate>
</dxpg:PivotGridField.CustomExcelStyleFilterPopupTemplate>
</dxpg:PivotGridField>
<dxpg:PivotGridField
Area="ColumnArea"
Caption="Year"
FieldName="OrderDate"
GroupInterval="DateYear"
Name="fieldYear"
AllowFilter="False"/>
<dxpg:PivotGridField
Area="ColumnArea"
Caption="Quarter"
FieldName="OrderDate"
GroupInterval="DateQuarter"
Name="fieldQuarter"
AllowFilter="False"/>
<dxpg:PivotGridField
Area="ColumnArea"
Caption="Month"
FieldName="OrderDate"
GroupInterval="DateMonth"
Name="fieldMonth"
AllowFilter="False"/>
<dxpg:PivotGridField
Area="RowArea"
AreaIndex="0"
Caption="Category Name"
FieldName="CategoryName"
Name="fieldCategoryName" />
<dxpg:PivotGridField
Area="RowArea"
AreaIndex="1"
Caption="Product Name"
FieldName="ProductName"
Name="fieldProductName" >
</dxpg:PivotGridField>
</dxpg:PivotGridControl.Fields>
</dxpg:PivotGridControl>
</Grid>
</dx:ThemedWindow>