-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
32 lines (32 loc) · 1.7 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
<Window x:Class="Forbid_Expand_Collapse.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:local="clr-namespace:Forbid_Expand_Collapse"
Height="400" Width="600">
<Window.Resources>
<DataTemplate x:Key="redRow" DataType="dxg:GridColumnData">
<TextBlock Text="{Binding DisplayText}" Foreground="Red"/>
</DataTemplate>
<DataTemplate x:Key="greenRow" DataType="dxg:GridColumnData">
<TextBlock Text="{Binding DisplayText}" Foreground="Green"/>
</DataTemplate>
<local:GroupRowTemplateSelector x:Key="groupRowTemplateSelector"
RedRowTemplate="{StaticResource redRow}"
GreenRowTemplate="{StaticResource greenRow}"/>
</Window.Resources>
<dxg:GridControl x:Name="grid"
EndGrouping="OnEndGrouping"
GroupRowCollapsing="OnGroupRowCollapsing"
GroupRowCollapsed="OnGroupRowCollapsed"
GroupRowExpanding="OnGroupRowExpanding"
GroupRowExpanded="OnGroupRowExpanded">
<dxg:GridColumn FieldName="ProductName"/>
<dxg:GridColumn FieldName="Price"/>
<dxg:GridColumn FieldName="Discount"/>
<dxg:GridColumn FieldName="Status" GroupIndex="0" SortOrder="Descending"/>
<dxg:GridControl.View>
<dxg:TableView x:Name="view" GroupValueTemplateSelector="{StaticResource groupRowTemplateSelector}"/>
</dxg:GridControl.View>
</dxg:GridControl>
</Window>