Mini Kabibi Habibi
<local:PivotGridDemoModule x:Class="PivotGridDemo.PivotGrid.SortBySummary"
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="400" Loaded="PivotGridDemoModule_Loaded">
<local:PivotGridDemoModule.Resources>
<ResourceDictionary>
<DataTemplate x:Key="FieldHeaderTemplate">
<dx:SimplePanel>
<Image Source="/PivotGridDemo;component/Images/HeaderIcons/Person.png" Stretch="None" HorizontalAlignment="Left"
VerticalAlignment="Center" Margin="0,-1,2,-1" />
<TextBlock Padding="18,0,0,0" Name="textBlock" Text="{Binding Path=DisplayText, Mode=OneWay}" HorizontalAlignment="Right"
Style="{Binding Path=ActualHeaderContentStyle}" />
</dx:SimplePanel>
</DataTemplate>
</ResourceDictionary>
</local:PivotGridDemoModule.Resources>
<dxdb:DemoModuleControl>
<dxdb:DemoModuleControl.OptionsContent>
<StackPanel Orientation="Vertical">
<dx:GroupFrame Header="Sorting Settings" Margin="0,0,0,8">
<StackPanel Orientation="Vertical">
<TextBlock VerticalAlignment="Center">Sort the "Sales Person" field by:</TextBlock>
<dxe:ComboBoxEdit Name="cbField" VerticalAlignment="Center" HorizontalAlignment="Stretch"
IsTextEditable="False" Margin="0,4,0,0" SelectedIndexChanged="cbField_SelectedIndexChanged" />
</StackPanel>
</dx:GroupFrame>
</StackPanel>
</dxdb:DemoModuleControl.OptionsContent>
<dxpg:PivotGridControl x:Name="pivotGrid" local:FieldAreaHelper.FixAreas="True" RowTreeWidth="220"
VerticalAlignment="Stretch" ShowColumnHeaders="False" ShowBorder="False" Loaded="pivotGrid_Loaded">
<dxpg:PivotGridControl.Fields>
<dxpg:PivotGridField x:Name="fieldQuarter" FieldName="OrderDate" Area="RowArea" AreaIndex="0"
UnboundFieldName="fieldQuarter" GroupInterval="DateMonth" Width="130"
Caption="Order Month" />
<dxpg:PivotGridField x:Name="fieldSalesPerson" FieldName="Sales Person" Area="RowArea" AreaIndex="1"
Width="130"
Caption="Sales Person" SortByField="{Binding ElementName=fieldExtendedPrice}" SortOrder="Descending"
HeaderTemplate="{StaticResource ResourceKey=FieldHeaderTemplate}"
HeaderListTemplate="{StaticResource ResourceKey=FieldHeaderTemplate}" />
<dxpg:PivotGridField x:Name="fieldExtendedPrice" FieldName="Extended Price" Area="DataArea" AreaIndex="0"
Caption="Order Amount" CellFormat="c" />
<dxpg:PivotGridField x:Name="fieldYear" FieldName="OrderDate" AreaIndex="0"
GroupInterval="DateYear"
UnboundFieldName="fieldYear" Caption="Order Year" />
<dxpg:PivotGridField x:Name="fieldQuantity" FieldName="Quantity" Area="DataArea" AreaIndex="1"
Caption="Quantity" />
<dxpg:PivotGridField x:Name="fieldDiscount" FieldName="Discount" Area="DataArea" AreaIndex="2"
Caption="Discount (Avg)" CellFormat="p" SummaryType="Average" />
</dxpg:PivotGridControl.Fields>
</dxpg:PivotGridControl>
</dxdb:DemoModuleControl>
</local:PivotGridDemoModule>