<Page
    x:Class="DemoMasterDetails.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:DemoMasterDetails"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:syncfusion="using:Syncfusion.UI.Xaml.Grid"
    xmlns:viewModel="using:DemoMasterDetails.ViewModel"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Page.DataContext>
        <viewModel:ViewModel />
    </Page.DataContext>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <syncfusion:SfDataGrid x:Name="dataGrid"
                               AutoGenerateColumns="True"
                               ColumnSizer="Auto"
                               ItemsSource="{Binding Path=OrdersInfo}"
                               NavigationMode="Cell"
                               SelectionMode="None">

            <syncfusion:SfDataGrid.DetailsViewDefinition>
                <syncfusion:GridViewDefinition RelationalColumn="OrderDetails">
                    <syncfusion:GridViewDefinition.DataGrid>
                        <syncfusion:SfDataGrid x:Name="FirstDetailsViewGrid">
                            <syncfusion:SfDataGrid.Columns>
                                <syncfusion:GridTextColumn HeaderText="Order ID" MappingName="OrderID" />
                                <syncfusion:GridTextColumn HeaderText="Customer ID" MappingName="CustomerID" />
                                <syncfusion:GridTextColumn HeaderText="Product ID"
                                                           MappingName="ProductID"
                                                           TextAlignment="Right" />
                                <syncfusion:GridTextColumn HeaderText="Unit Price" MappingName="UnitPrice" />
                                <syncfusion:GridTextColumn MappingName="Quantity" TextAlignment="Right" />
                                <syncfusion:GridNumericColumn FormatString="P"
                                                              MappingName="Discount"
                                                              TextAlignment="Right" />
                                <syncfusion:GridTextColumn HeaderText="Order Date" MappingName="OrderDate" />
                            </syncfusion:SfDataGrid.Columns>
                        </syncfusion:SfDataGrid>
                    </syncfusion:GridViewDefinition.DataGrid>
                </syncfusion:GridViewDefinition>
            </syncfusion:SfDataGrid.DetailsViewDefinition>
        </syncfusion:SfDataGrid>
        <Button Grid.Row="1" x:Name="PrintButton" Content="Print"  Command="{x:Bind PrintCommand}"  ToolTipService.ToolTip="Druckvorschau"/>
    </Grid>
</Page>

