<Window xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"  x:Class="OData.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="OData FlexGrid Application" WindowState="Maximized" Height="350" Width="525">
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="auto" />
            <RowDefinition Height="2*" />
        </Grid.RowDefinitions>
        <!-- title -->
        <StackPanel Orientation="Vertical" Margin="0 10 0 0" >
            <TextBlock Text="C1FlexGrid: NorthWind OData" FontSize="18"/>
            <TextBlock TextWrapping="Wrap" Text="This sample uses the NorthWind OData service available at http://services.odata.org/Northwind/Northwind.svc/. When you select a category on the top grid, the corresponding products are shown on the bottom grid." />
        </StackPanel>

        <!-- categories -->
        <StackPanel Orientation="Horizontal" Margin="0 10 0 0" Grid.Row="1">
            <TextBlock Name="_lblCategories" Text="Categories (loading...)" VerticalAlignment="Center"/>
        </StackPanel>
        <c1:C1FlexGrid Name="_flexCategories" AutoGenerateColumns="False" SelectionMode="Row" Grid.Row="2" >
            <c1:C1FlexGrid.Columns>
                <c1:Column Binding="{Binding CategoryName}" Width="*" />
                <c1:Column Binding="{Binding Description}" Width="4*" />
            </c1:C1FlexGrid.Columns>
        </c1:C1FlexGrid>

        <!-- products -->
        <StackPanel Orientation="Horizontal" Margin="0 10 0 0" Grid.Row="3" >
            <TextBlock Name="_lblProducts" Text="Products" VerticalAlignment="Center" />
        </StackPanel>
        <c1:C1FlexGrid Name="_flexProducts" AutoGenerateColumns="False" SelectionMode="RowRange" Grid.Row="4" >
            <c1:C1FlexGrid.Columns>
                <c1:Column Binding="{Binding ProductName}" Width="3*" />
                <c1:Column Binding="{Binding QuantityPerUnit}" Width="3*" />
                <c1:Column Binding="{Binding UnitPrice, StringFormat=n2}" Width="*" HorizontalAlignment="Right" />
                <c1:Column Binding="{Binding UnitsInStock}" Width="*" HorizontalAlignment="Right" />
                <c1:Column Binding="{Binding ReorderLevel}" Width="*" HorizontalAlignment="Right" />
                <c1:Column Binding="{Binding UnitsOnOrder}" Width="*" HorizontalAlignment="Right" />
                <c1:Column Binding="{Binding Discontinued}" Width="*" HorizontalAlignment="Center" />
            </c1:C1FlexGrid.Columns>
        </c1:C1FlexGrid>
    </Grid>
</Window>
