/
MainWindow.xaml
64 lines (64 loc) · 3.09 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
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:fGrid11"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
x:Class="fGrid11.MainWindow"
Title="Styles and Templates in code"
Height="400"
Width="800"
SnapsToDevicePixels="True"
UseLayoutRounding="True">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<dxg:GridControl Name="gridControl1" Grid.ColumnSpan="2"
ItemsSource="{x:Static local:Person.CreateList}"
ShowBorder="False"
AutoGenerateColumns="KeepOld">
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="LastName" >
<!--<dxg:GridColumn.CellStyle>
<Style TargetType="{x:Type dxg:LightweightCellEditor}">
<Setter Property="Background" Value="LightGreen" />
</Style>
</dxg:GridColumn.CellStyle>
<dxg:GridColumn.CellTemplate>
<DataTemplate>
<dxe:TextEdit Name="PART_Editor"
HorizontalContentAlignment="Center"
FontSize="{Binding RowData.Row.NameFontSize}" />
</DataTemplate>
</dxg:GridColumn.CellTemplate>-->
</dxg:GridColumn>
<dxg:GridColumn FieldName="Age">
<!--<dxg:GridColumn.CellTemplate>
<DataTemplate>
<dxe:TextEdit Name="PART_Editor"
HorizontalContentAlignment="Center"
IsReadOnly="{Binding RowData.EvenRow}" />
</DataTemplate>
</dxg:GridColumn.CellTemplate>-->
</dxg:GridColumn>
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<dxg:TableView Name="tableView1"
ShowGroupPanel="False"/>
</dxg:GridControl.View>
</dxg:GridControl>
<Button Grid.Row="1"
Content="Change FontSize for LastName and make Age in even rows read only"
Click="AddCellTemplateButton_Click_1" />
<Button Grid.Row="1" Grid.Column="1"
Content="Add a custom style to LastName"
Click="AddStyleButton_Click_1" />
</Grid>
</Window>