-
Notifications
You must be signed in to change notification settings - Fork 15
/
MainPage.xaml
65 lines (65 loc) · 3.4 KB
/
MainPage.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
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:dx="http://schemas.devexpress.com/maui"
xmlns:local="clr-namespace:ColumnHeaderTemplate"
xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
ios:Page.UseSafeArea="true"
x:Class="ColumnHeaderTemplate.MainPage">
<ContentPage.BindingContext>
<local:EmployeeDataViewModel/>
</ContentPage.BindingContext>
<dx:DataGridView ItemsSource="{Binding Employees}">
<dx:DataGridView.Columns>
<dx:ImageColumn FieldName="Photo">
<dx:ImageColumn.HeaderContentTemplate>
<DataTemplate>
<dx:DXStackLayout Orientation="Horizontal" HorizontalOptions="Center">
<dx:DXImage Source="photo.png" VerticalOptions="Center"/>
<Label Text="{Binding FieldName}" VerticalOptions="Center"/>
</dx:DXStackLayout>
</DataTemplate>
</dx:ImageColumn.HeaderContentTemplate>
</dx:ImageColumn>
<dx:TextColumn FieldName="Name">
<dx:TextColumn.HeaderContentTemplate>
<DataTemplate>
<dx:DXStackLayout Orientation="Horizontal">
<dx:DXImage Source="full_name.png" VerticalOptions="Center"/>
<Label Text="Full Name" VerticalOptions="Center"/>
</dx:DXStackLayout>
</DataTemplate>
</dx:TextColumn.HeaderContentTemplate>
</dx:TextColumn>
<dx:TextColumn FieldName="Position">
<dx:TextColumn.HeaderContentTemplate>
<DataTemplate>
<dx:DXStackLayout Orientation="Horizontal">
<dx:DXImage Source="job_title.png" VerticalOptions="Center"/>
<Label Text="Job Title" VerticalOptions="Center"/>
</dx:DXStackLayout>
</DataTemplate>
</dx:TextColumn.HeaderContentTemplate>
</dx:TextColumn>
<dx:TextColumn FieldName="Phone">
<dx:TextColumn.HeaderContentTemplate>
<DataTemplate>
<dx:DXStackLayout Orientation="Horizontal">
<dx:DXImage Source="phone.png" VerticalOptions="Center"/>
<Label Text="{Binding FieldName}" VerticalOptions="Center"/>
</dx:DXStackLayout>
</DataTemplate>
</dx:TextColumn.HeaderContentTemplate>
</dx:TextColumn>
<dx:DateColumn FieldName="HireDate">
<dx:DateColumn.HeaderContentTemplate>
<DataTemplate>
<dx:DXStackLayout Orientation="Horizontal">
<dx:DXImage Source="hire_date.png" VerticalOptions="Center"/>
<Label Text="Hire Date" VerticalOptions="Center"/>
</dx:DXStackLayout>
</DataTemplate>
</dx:DateColumn.HeaderContentTemplate>
</dx:DateColumn>
</dx:DataGridView.Columns>
</dx:DataGridView>
</ContentPage>