-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
65 lines (64 loc) · 3.85 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
<Window x:Class="PrintCustomGroupRows.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:PrintCustomGroupRows"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
Height="450" Width="800">
<Window.Resources>
<local:RemoveParenthesesConverter x:Key="ParenthesesConverter"/>
<local:PrintRowInfoToImageSourceConverter x:Key="ImageSourceConverter"/>
<DataTemplate x:Key="PrintGroupRowTemplate">
<Grid Width="{Binding Path=Content.(dxg:GridPrintingHelper.PrintGroupRowInfo).CaptionCell.Width}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<dxg:CellFillControl Style="{Binding Path=Content.(dxg:GridPrintingHelper.PrintRowInfo).PrintRowIndentStyle}"/>
<dxe:ImageEdit Source="{Binding Content.GroupValue.Value, Converter={StaticResource ImageSourceConverter}}"
Style="{Binding Path=Content.(dxg:GridPrintingHelper.PrintGroupRowInfo).CaptionCell.PrintGroupRowStyle}"
IsPrintingMode="True"
Grid.Column="1"
Width="32"
Height="32"
BorderThickness="1,0,0,1"/>
<dxe:TextEdit EditValue="{Binding Path=Content.(dxg:GridPrintingHelper.PrintGroupRowInfo).CaptionCell.Text, Mode=OneWay}"
Style="{Binding Path=Content.(dxg:GridPrintingHelper.PrintGroupRowInfo).CaptionCell.PrintGroupRowStyle}"
IsPrintingMode="True"
Grid.Column="2"
BorderThickness="0,0,0,1"
HorizontalAlignment="Stretch"/>
<dxe:TextEdit EditValue="{Binding Path=Content.(dxg:GridPrintingHelper.PrintGroupRowInfo).FirstColumnCell.Text, Mode=OneWay, Converter={StaticResource ParenthesesConverter}}"
Style="{Binding Path=Content.(dxg:GridPrintingHelper.PrintGroupRowInfo).CaptionCell.PrintGroupRowStyle}"
IsPrintingMode="True"
Grid.Column="3"
BorderThickness="0,0,1,1"
HorizontalAlignment="Right"/>
</Grid>
</DataTemplate>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<dxg:GridControl x:Name="grid">
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="ID"/>
<dxg:GridColumn FieldName="Name"/>
<dxg:GridColumn FieldName="Value"/>
<dxg:GridColumn FieldName="Category" GroupIndex="0"/>
</dxg:GridControl.Columns>
<dxg:GridControl.GroupSummary>
<dxg:GridSummaryItem FieldName="Value" SummaryType="Sum"/>
<dxg:GridSummaryItem SummaryType="Count"/>
</dxg:GridControl.GroupSummary>
<dxg:GridControl.View>
<dxg:TableView x:Name="view" PrintAllGroups="False" PrintGroupRowTemplate="{StaticResource PrintGroupRowTemplate}"/>
</dxg:GridControl.View>
</dxg:GridControl>
<Button Grid.Row="1" Content="Show Print Preview" Command="{Binding Commands.ShowPrintPreview, ElementName=view}"/>
</Grid>
</Window>