<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="C1_MDSL.Page" mc:Ignorable="d" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <TextBlock Text="Master-Detail Sample in Silverlight" Margin="5,5,5,20" Grid.Row="0" FontSize="20" FontWeight="Bold" FontFamily="Trebuchet MS" Foreground="#FF2F4255" />
        
        <TextBlock Text="Categories" Margin="20,5,20,5" Grid.Row="1" FontSize="16" FontWeight="Bold" Foreground="#FF175B9A" FontFamily="Trebuchet MS" />
        <!-- 
             To allow add/remove rows using buil-int functionality:
             Set the CanUserAddRows, CanUserEditRows and CanUserRemoveRows to True.
             Set method = 4 in BindData() method (page.xaml.cs)
        -->
        <c1:C1DataGrid x:Name="_gridCategories" Margin="20,5,20,5" Grid.Row="2" SelectionChanged="_gridCategories_SelectionChanged" SelectedIndex="0" CanUserAddRows="True" CanUserRemoveRows="True" CanUserEditRows="True" BeginningNewRow="_gridCategories_BeginningNewRow" DeletingRows="_gridCategories_DeletingRows" AutoGeneratingColumn="_gridCategories_AutoGeneratingColumn" />

        <TextBlock Text="Products" Margin="20,5,20,5" Grid.Row="3" FontSize="16" FontWeight="Bold" Foreground="#FF175B9A" FontFamily="Trebuchet MS" />
        <!-- 
             To allow add/remove rows using buil-int functionality:
             Set the CanUserAddRows, CanUserEditRows and CanUserRemoveRows to True.
             Set method = 4 in BindData() method (page.xaml.cs)
        -->
        <c1:C1DataGrid x:Name="_gridProducts" Margin="20,5,20,5" Grid.Row="4" CanUserAddRows="False" CanUserRemoveRows="False" CanUserEditRows="False" BeginningNewRow="_gridProducts_BeginningNewRow" />

        <StackPanel Margin="20,5,20,5" Orientation="Horizontal" Grid.Row="5">
    		<Button x:Name="_btnAdd" Content=" Add Item " Margin="0,0,20,0" FontSize="11" VerticalAlignment="Center" Click="_btnAdd_Click" />
    		<Button x:Name="_btnRemove" Content=" Remove Item " Margin="0,0,20,0" FontSize="11" VerticalAlignment="Center" Click="_btnRemove_Click" />
    		<Button x:Name="_btnCommit" Content=" Commit Changes " Margin="0,0,20,0" FontSize="11" VerticalAlignment="Center" Click="_btnCommit_Click" IsEnabled="False" ToolTipService.ToolTip="Disabled in Live environment." />
            <TextBlock x:Name="_tbStatus" Text="Ready" VerticalAlignment="Center" FontSize="11" Foreground="Gray" />
        </StackPanel>
    </Grid>
</UserControl>