-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMainPage.xaml
51 lines (50 loc) · 2.79 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
<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:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
ios:Page.UseSafeArea="True"
xmlns:local="clr-namespace:DataGridExample"
x:Class="DataGridExample.MainPage">
<ContentPage.BindingContext>
<local:EmployeeDataViewModel/>
</ContentPage.BindingContext>
<dx:DataGridView ItemsSource="{Binding Employees}"
EditorShowMode="DoubleTap"
AllowDragDropRows="True">
<dx:DataGridView.Columns>
<dx:TemplateColumn FieldName="Photo" Width="100">
<dx:TemplateColumn.DisplayTemplate>
<DataTemplate>
<Image Source="{Binding Item.Photo}" Margin="3"/>
</DataTemplate>
</dx:TemplateColumn.DisplayTemplate>
</dx:TemplateColumn>
<dx:TemplateColumn FieldName="Name" Caption="Employee" MinWidth="200">
<dx:TemplateColumn.DisplayTemplate>
<DataTemplate>
<Grid VerticalOptions="Center" Padding="15, 0, 0, 0" RowDefinitions="Auto, Auto, Auto">
<Label Text="{Binding Item.Name}" FontSize="18" FontAttributes="Bold"
TextColor="{DynamicResource GridCellFontColor}" Grid.Row="0" />
<Label Text="{Binding Item.Position, StringFormat = 'Job Title: {0}'}"
FontSize="Small" TextColor="{DynamicResource GridCellFontColor}"
Grid.Row="1"/>
<Label Text="{Binding Item.HireDate, StringFormat = 'Hire Date: {0:d}'}"
FontSize="Small" TextColor="{DynamicResource GridCellFontColor}"
Grid.Row="2" />
</Grid>
</DataTemplate>
</dx:TemplateColumn.DisplayTemplate>
</dx:TemplateColumn>
<dx:TextColumn FieldName="Phone"
MinWidth="130" VerticalContentAlignment="Center" />
<dx:TextColumn FieldName="Address"
MinWidth="150" VerticalContentAlignment="Center" />
<dx:DateColumn FieldName="BirthDate"
MinWidth="120" DisplayFormat="d" VerticalContentAlignment="Center"/>
<dx:ComboBoxColumn FieldName="Access" Caption="Access Level"
MinWidth="140" VerticalContentAlignment="Center"/>
<dx:CheckBoxColumn FieldName="OnVacation"
MinWidth="130" VerticalContentAlignment="Center"/>
</dx:DataGridView.Columns>
</dx:DataGridView>
</ContentPage>