|
| 1 | +<?xml version="1.0" encoding="utf-8" ?> |
| 2 | +<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
| 4 | + xmlns:syncfusion="clr-namespace:Syncfusion.Maui.DataGrid;assembly=Syncfusion.Maui.DataGrid" |
| 5 | + xmlns:local="clr-namespace:DataGridMAUI" |
| 6 | + x:Class="DataGridMAUI.MainPage"> |
| 7 | + |
| 8 | + <ContentPage.BindingContext> |
| 9 | + <local:ViewModel x:Name="viewModel"/> |
| 10 | + </ContentPage.BindingContext> |
| 11 | +<syncfusion:SfDataGrid x:Name="dataGrid" |
| 12 | + AutoGenerateColumnsMode="None" |
| 13 | + ColumnWidthMode="Fill" |
| 14 | + ItemsSource="{Binding OrdersInfo}" |
| 15 | + RowHeight="180"> |
| 16 | + <syncfusion:SfDataGrid.Columns> |
| 17 | + <syncfusion:DataGridTemplateColumn HeaderText="Orders Information" MappingName="OrderID"> |
| 18 | + <syncfusion:DataGridTemplateColumn.CellTemplate> |
| 19 | + <DataTemplate> |
| 20 | + <Grid> |
| 21 | + <Grid.ColumnDefinitions> |
| 22 | + <ColumnDefinition Width="100" /> |
| 23 | + <ColumnDefinition Width="100" /> |
| 24 | + <ColumnDefinition Width="100" /> |
| 25 | + </Grid.ColumnDefinitions> |
| 26 | + <Grid.RowDefinitions> |
| 27 | + <RowDefinition Height="40" /> |
| 28 | + <RowDefinition Height="40" /> |
| 29 | + <RowDefinition Height="40" /> |
| 30 | + <RowDefinition Height="40" /> |
| 31 | + </Grid.RowDefinitions> |
| 32 | + <Label Grid.Row="0" |
| 33 | + Grid.Column="0" |
| 34 | + FontAttributes="Bold" |
| 35 | + HorizontalTextAlignment="Center" |
| 36 | + Text="Order ID" |
| 37 | + TextColor="Black" |
| 38 | + VerticalTextAlignment="Center" /> |
| 39 | + <Label Grid.Row="0" |
| 40 | + Grid.Column="1" |
| 41 | + HorizontalTextAlignment="Center" |
| 42 | + Text=":" |
| 43 | + TextColor="Black" |
| 44 | + VerticalTextAlignment="Center" /> |
| 45 | + <Label Grid.Row="0" |
| 46 | + Grid.Column="2" |
| 47 | + HorizontalTextAlignment="Center" |
| 48 | + Text="{Binding OrderID}" |
| 49 | + VerticalTextAlignment="Center" /> |
| 50 | + <Label Grid.Row="1" |
| 51 | + Grid.Column="0" |
| 52 | + FontAttributes="Bold" |
| 53 | + HorizontalTextAlignment="Center" |
| 54 | + Text="Customer ID" |
| 55 | + TextColor="Black" |
| 56 | + VerticalTextAlignment="Center" /> |
| 57 | + <Label Grid.Row="1" |
| 58 | + Grid.Column="1" |
| 59 | + HorizontalTextAlignment="Center" |
| 60 | + Text=":" |
| 61 | + TextColor="Black" |
| 62 | + VerticalTextAlignment="Center" /> |
| 63 | + <Label Grid.Row="1" |
| 64 | + Grid.Column="2" |
| 65 | + HorizontalTextAlignment="Center" |
| 66 | + Text="{Binding CustomerID}" |
| 67 | + VerticalTextAlignment="Center" /> |
| 68 | + <Label Grid.Row="2" |
| 69 | + Grid.Column="0" |
| 70 | + FontAttributes="Bold" |
| 71 | + HorizontalTextAlignment="Center" |
| 72 | + Text="Freight" |
| 73 | + TextColor="Black" |
| 74 | + VerticalTextAlignment="Center" /> |
| 75 | + <Label Grid.Row="2" |
| 76 | + Grid.Column="1" |
| 77 | + HorizontalTextAlignment="Center" |
| 78 | + Text=":" |
| 79 | + TextColor="Black" |
| 80 | + VerticalTextAlignment="Center" /> |
| 81 | + <Label Grid.Row="2" |
| 82 | + Grid.Column="2" |
| 83 | + HorizontalTextAlignment="Center" |
| 84 | + Text="{Binding Freight}" |
| 85 | + VerticalTextAlignment="Center" /> |
| 86 | + <Label Grid.Row="3" |
| 87 | + Grid.Column="0" |
| 88 | + FontAttributes="Bold" |
| 89 | + HorizontalTextAlignment="Center" |
| 90 | + Text="Country" |
| 91 | + TextColor="Black" |
| 92 | + VerticalTextAlignment="Center" /> |
| 93 | + <Label Grid.Row="3" |
| 94 | + Grid.Column="1" |
| 95 | + HorizontalTextAlignment="Center" |
| 96 | + Text=":" |
| 97 | + TextColor="Black" |
| 98 | + VerticalTextAlignment="Center" /> |
| 99 | + <Label Grid.Row="3" |
| 100 | + Grid.Column="2" |
| 101 | + HorizontalTextAlignment="Center" |
| 102 | + Text="{Binding Country}" |
| 103 | + VerticalTextAlignment="Center" /> |
| 104 | + </Grid> |
| 105 | + </DataTemplate> |
| 106 | + </syncfusion:DataGridTemplateColumn.CellTemplate> |
| 107 | + </syncfusion:DataGridTemplateColumn> |
| 108 | + </syncfusion:SfDataGrid.Columns> |
| 109 | +</syncfusion:SfDataGrid> |
| 110 | + |
| 111 | +</ContentPage> |
0 commit comments