<Window x:Class="One_to_Many_Relationship.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:One_to_Many_Relationship"
        mc:Ignorable="d"
        Title="One-to-Many-Relationship" Height="450" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <DataGrid Name="gridCategories" AutoGenerateColumns="False" SelectedIndex="0">
            <DataGrid.Columns>
                <DataGridTextColumn Header="CategoryID" Binding="{Binding CategoryID}" />
                <DataGridTextColumn Header="CategoryName" Binding="{Binding CategoryName}" />
                <DataGridTextColumn Header="Description" Binding="{Binding Description}" />
            </DataGrid.Columns>
        </DataGrid>
        <GridSplitter Margin="0 3 0 3" Grid.Row="1" ShowsPreview="True" Background="Black" Height="5" HorizontalAlignment="Stretch" />
        <DataGrid Grid.Row="2" Name="grid2" ItemsSource="{Binding ElementName=gridCategories, Path=SelectedItem.Products}" AutoGenerateColumns="False">
            <DataGrid.Columns>
                <DataGridTextColumn Header="ProductID" Binding="{Binding ProductID}" />
                <DataGridTextColumn Header="ProductName" Binding="{Binding ProductName}" />
                <DataGridTextColumn Header="QuantityPerUnit" Binding="{Binding QuantityPerUnit}" />
                <DataGridTextColumn Header="UnitPrice" Binding="{Binding UnitPrice}" />
                <DataGridTextColumn Header="UnitsInStock" Binding="{Binding UnitsInStock}" />
                <DataGridTextColumn Header="UnitsOnOrder" Binding="{Binding UnitsOnOrder}" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</Window>
