Mini Kabibi Habibi
<local:PivotGridDemoModule x:Class="PivotGridDemo.PivotGrid.SingleTotal"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:PivotGridDemo.PivotGrid"
xmlns:dxpg="http://schemas.devexpress.com/winfx/2008/xaml/pivotgrid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxdb="http://schemas.devexpress.com/winfx/2008/xaml/demobase"
Height="300" Width="300">
<dxdb:DemoModuleControl>
<dxdb:DemoModuleControl.OptionsContent>
<StackPanel Orientation="Vertical" MinWidth="240">
<dx:GroupFrame Header="DataField Summary Settings" Margin="0,0,0,8">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" Margin="0,0,8,4">Field:</TextBlock>
<dxe:ComboBoxEdit Grid.Column="1" Grid.Row="0"
Name="cbField" VerticalAlignment="Center" HorizontalAlignment="Stretch"
Margin="0,0,0,4"
IsTextEditable="False" Width="85" SelectedIndexChanged="cbField_SelectedIndexChanged" />
<TextBlock Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" Margin="0,0,8,0">Summary Type:</TextBlock>
<dxe:ComboBoxEdit Grid.Column="1" Grid.Row="1"
Name="cbSummaryType" VerticalAlignment="Center" HorizontalAlignment="Stretch"
IsTextEditable="False" Width="85" SelectedIndexChanged="cbSummaryType_SelectedIndexChanged" />
</Grid>
</dx:GroupFrame>
<dx:GroupFrame Header="View Options" VerticalAlignment="Stretch">
<StackPanel>
<dxe:CheckEdit IsChecked="{Binding ElementName=pivotGrid, Path=ShowColumnGrandTotalHeader, Mode=TwoWay}" Content="Show Column Grand Total Header" Name="ceShowColumnGrandTotalHeader" Height="16" Margin="0,0,0,4" />
<dxe:CheckEdit IsChecked="{Binding ElementName=pivotGrid, Path=ShowColumnGrandTotals, Mode=TwoWay}" Content="Show Column Grand Totals" Name="ceShowColumnGrandTotals" Height="16" Margin="0,0,0,4" />
<dxe:CheckEdit IsChecked="{Binding ElementName=pivotGrid, Path=ShowColumnTotals, Mode=TwoWay}" Content="Show Column Totals" Name="ceShowColumnTotals" Height="16" Margin="0,0,0,4" />
<dxe:CheckEdit IsChecked="{Binding ElementName=pivotGrid, Path=ShowRowGrandTotalHeader, Mode=TwoWay}" Content="Show Row Grand Total Header" Name="ceShowRowGrandTotalHeader" Height="16" Margin="0,0,0,4" />
<dxe:CheckEdit IsChecked="{Binding ElementName=pivotGrid, Path=ShowRowGrandTotals, Mode=TwoWay}" Content="Show Row Grand Totals" Name="ceShowRowGrandTotals" Height="16" Margin="0,0,0,4" />
<dxe:CheckEdit IsChecked="{Binding ElementName=pivotGrid, Path=ShowRowTotals, Mode=TwoWay}" Content="Show Row Totals" Name="ceShowRowTotals" Height="16" Margin="0,0,0,4" />
<dxe:CheckEdit IsChecked="{Binding ElementName=pivotGrid, Path=ShowGrandTotalsForSingleValues, Mode=TwoWay}" Content="Show Grand Totals For Single Values" Name="ceShowGrandTotalsForSingleValues" Height="16" Margin="0,0,0,4" />
<dxe:CheckEdit IsChecked="{Binding ElementName=pivotGrid, Path=ShowTotalsForSingleValues, Mode=TwoWay}" Content="Show Totals For Single Values" Name="ceShowTotalsForSingleValues" Height="16" Margin="0,0,0,4" />
</StackPanel>
</dx:GroupFrame>
</StackPanel>
</dxdb:DemoModuleControl.OptionsContent>
<dxpg:PivotGridControl x:Name="pivotGrid" local:FieldAreaHelper.FixAreas="True" CustomSummary="OnPivotGridCustomSummary" RowTotalsLocation="Far"
RowTreeWidth="305" ShowBorder="False" VerticalAlignment="Stretch" ShowColumnGrandTotals="False" ShowFilterHeaders="False" DataFieldAreaIndex="2" DataFieldArea="ColumnArea" DataFieldCaption="Data" SummaryDataSourceFieldNaming="FieldName" Loaded="pivotGrid_Loaded">
<dxpg:PivotGridControl.Fields>
<dxpg:PivotGridField x:Name="fieldProduct" FieldName="ProductName" Area="RowArea" AreaIndex="1" Width="215" Caption="Product Name" />
<dxpg:PivotGridField x:Name="fieldCategory" FieldName="CategoryName" Area="RowArea" AreaIndex="0" Width="130" Caption="Category Name" />
<dxpg:PivotGridField x:Name="fieldQuarter" ValueFormat="Quarter {0}" FieldName="OrderDate" AreaIndex="1" Area="ColumnArea" GroupInterval="DateQuarter"
Width="80" Caption="Quarter" />
<dxpg:PivotGridField x:Name="fieldYear" FieldName="OrderDate" Area="ColumnArea" GroupInterval="DateYear" AreaIndex="0" Width="80" Caption="Year" />
<dxpg:PivotGridField x:Name="fieldQuantity" FieldName="Quantity" SummaryType="Sum" ShowSummaryTypeName="True" AreaIndex="1" Area="DataArea"
Width="70" Caption="Quantity" />
<dxpg:PivotGridField x:Name="fieldDiscount" FieldName="Discount" SummaryType="Average" ShowSummaryTypeName="True" AreaIndex="2" Area="DataArea"
Width="70" Caption="Discount" CellFormat="p" ValueFormat="p" />
<dxpg:PivotGridField x:Name="fieldUnitPrice" FieldName="UnitPrice" SummaryType="Max" ShowSummaryTypeName="True" AreaIndex="0" Area="DataArea"
Width="130" Caption="Unit Price" />
</dxpg:PivotGridControl.Fields>
</dxpg:PivotGridControl>
</dxdb:DemoModuleControl>
</local:PivotGridDemoModule>