-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainWindow.xaml
140 lines (139 loc) · 9.26 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<syncfusion:ChromelessWindow x:Class="DataGrid_Themes.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:DataGrid_Themes"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
Icon="App.ico"
Title="Getting Started"
WindowStartupLocation="CenterScreen">
<syncfusion:ChromelessWindow.Resources>
<local:ViewModel x:Key="viewmodel" />
<local:SelectedImageConverter x:Key="selectedImageConverter"/>
<local:StatusConverter x:Key="statusConverter"/>
<local:TrustImageConverter x:Key="trustImageConverter"/>
<Style TargetType="syncfusion:SfRatingItem">
<Setter Property="Padding" Value="1" />
<Setter Property="Height" Value="20" />
<Setter Property="Width" Value="22" />
</Style>
<Style TargetType="syncfusion:SfRating">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
</syncfusion:ChromelessWindow.Resources>
<Grid DataContext="{StaticResource viewmodel}">
<syncfusion:SfDataGrid Name="sfgrid" Margin="5"
AutoGenerateColumns="False"
AllowDraggingColumns="True"
AllowEditing="True"
LiveDataUpdateMode="AllowDataShaping"
AllowFiltering="True"
HeaderRowHeight="26"
SelectionMode="Extended"
ColumnSizer="Auto"
ItemsSource="{Binding EmployeeDetails}">
<syncfusion:SfDataGrid.Columns>
<syncfusion:GridCheckBoxSelectorColumn MappingName="Selected" AllowFiltering="False" Width="30"
AllowSorting="False" AllowCheckBoxOnHeader="True"/>
<syncfusion:GridTemplateColumn MappingName="EmployeeName" Padding="2"
HeaderText="Employee Name">
<syncfusion:GridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid Margin="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="15"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image Source="{Binding Gender,
Converter={StaticResource selectedImageConverter}}"
Height="15" Width="15" Grid.Column="0"/>
<TextBlock Text="{Binding EmployeeName}" Padding="4"
VerticalAlignment="Center" Grid.Column="1"/>
</Grid>
</DataTemplate>
</syncfusion:GridTemplateColumn.CellTemplate>
</syncfusion:GridTemplateColumn>
<syncfusion:GridTextColumn MappingName="Designation" HeaderText="Designation"/>
<syncfusion:GridTextColumn MappingName="Mail" HeaderText="Mail"/>
<syncfusion:GridTemplateColumn MappingName="Location" Width="100"
HeaderText="Location">
<syncfusion:GridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid Margin="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="15"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image Source="Images/location.png" Height="15"
Grid.Column="0" Width="15"/>
<TextBlock Text="{Binding Location}" Padding="4"
VerticalAlignment="Center" Grid.Column="1"/>
</Grid>
</DataTemplate>
</syncfusion:GridTemplateColumn.CellTemplate>
</syncfusion:GridTemplateColumn>
<syncfusion:GridTemplateColumn MappingName="Status" Width="90" HeaderText="Status">
<syncfusion:GridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Foreground="{Binding Status,
Converter={StaticResource statusConverter}}"
Padding="3" Text="{Binding Status}"/>
</DataTemplate>
</syncfusion:GridTemplateColumn.CellTemplate>
<syncfusion:GridTemplateColumn.EditTemplate>
<DataTemplate>
<syncfusion:ComboBoxAdv SelectedValue="{Binding Status}" ItemsSource="{Binding Status, Source={StaticResource viewmodel}}"/>
</DataTemplate>
</syncfusion:GridTemplateColumn.EditTemplate>
</syncfusion:GridTemplateColumn>
<syncfusion:GridTemplateColumn MappingName="Trustworthiness" HeaderText="Trust Worthiness">
<syncfusion:GridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid Margin="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="15"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image Source="{Binding Trustworthiness,
Converter={StaticResource trustImageConverter}}"
Height="15" Width="15" Grid.Column="0"/>
<TextBlock Text="{Binding Trustworthiness}" Padding="4"
VerticalAlignment="Center" Grid.Column="1"/>
</Grid>
</DataTemplate>
</syncfusion:GridTemplateColumn.CellTemplate>
<syncfusion:GridTemplateColumn.EditTemplate>
<DataTemplate>
<syncfusion:ComboBoxAdv SelectedValue="{Binding Trustworthiness}" ItemsSource="{Binding Trustworthiness, Source={StaticResource viewmodel}}"/>
</DataTemplate>
</syncfusion:GridTemplateColumn.EditTemplate>
</syncfusion:GridTemplateColumn>
<syncfusion:GridTemplateColumn MappingName="Rating" Width="130">
<syncfusion:GridTemplateColumn.CellTemplate>
<DataTemplate>
<syncfusion:SfRating VerticalAlignment="Center" ItemsCount="5" ShowToolTip="False"
Value="{Binding Rating, Mode=TwoWay}"/>
</DataTemplate>
</syncfusion:GridTemplateColumn.CellTemplate>
</syncfusion:GridTemplateColumn>
<syncfusion:GridTextColumn Width="90" DisplayBinding="{Binding Path=Salary,
StringFormat='{}{0:C}'}"
TextAlignment="Right" HeaderText="Salary"/>
<syncfusion:GridTextColumn MappingName="Address" HeaderText="Address"/>
<syncfusion:GridPercentColumn HeaderText="Software Proficiency" AllowEditing="False"
MappingName="SoftwareProficiency">
<syncfusion:GridPercentColumn.CellTemplate>
<DataTemplate>
<Grid>
<ProgressBar Background="Transparent" BorderThickness="0" Maximum=".99"
Value="{Binding SoftwareProficiency,StringFormat=P}"/>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
Text="{Binding SoftwareProficiency, StringFormat=P}"/>
</Grid>
</DataTemplate>
</syncfusion:GridPercentColumn.CellTemplate>
</syncfusion:GridPercentColumn>
</syncfusion:SfDataGrid.Columns>
</syncfusion:SfDataGrid>
</Grid>
</syncfusion:ChromelessWindow>