<UserControl
    x:Class="FlexGridSamples.CollectionView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:FlexGridSamples"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:c1="using:C1.Xaml.FlexGrid"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Margin="-4,0,0,0">
            <StackPanel.Resources>
                <Style TargetType="TextBlock">
                    <Setter Property="FontSize" Value="14"/>
                    <Setter Property="Margin" Value="10,0,6,0"/>
                    <Setter Property="VerticalAlignment" Value="Center"/>
                </Style>
            </StackPanel.Resources>

            <TextBlock Text="Group on:" HorizontalAlignment="Right"/>
            <ComboBox 
                        Name="groupComboBox" Grid.Column="1" SelectionChanged="groupComboBox_SelectionChanged" 
                        Height="30" Width="110" Margin="5"/>
            <TextBlock Text="Filter on:" Grid.Row="1" HorizontalAlignment="Right"/>
            <ComboBox 
                        Name="filterComboBox" Grid.Row="1" Grid.Column="1" SelectionChanged="filterComboBox_SelectionChanged"
                        Height="30" Width="110" Margin="5"/>
            <TextBox 
                        Name="filterTextBox" Grid.Row="1" Grid.Column="2" TextChanged="filterTextBox_TextChanged" Height="25" 
                        Width="150" Margin="5"/>
        </StackPanel>

        <!-- FlexGrid -->
        <c1:C1FlexGrid x:Name="c1FlexGrid1" AutoGenerateColumns="False" IsReadOnly="True" ShowOutlineBar="True" Grid.Row="1" BorderThickness="1">
            <c1:C1FlexGrid.Columns>
                <c1:Column Binding="{Binding Name}" Width="*"/>
                <c1:Column Binding="{Binding Line}" />
                <c1:Column Binding="{Binding Color}" />
                <c1:Column Binding="{Binding Price}" Format="c2" GroupAggregate="Sum" Width="*"/>
                <c1:Column Binding="{Binding Weight}" Format="n2" GroupAggregate="Sum" Width="*" />
                <c1:Column Binding="{Binding Cost}" Format="c2" GroupAggregate="Sum" Width="*"/>
                <c1:Column Binding="{Binding Volume}" GroupAggregate="Sum" Width="*"/>
                <c1:Column Binding="{Binding Rating}" Format="n2" GroupAggregate="Average" Width="*"/>
                <c1:Column Binding="{Binding Discontinued}" Width="*"/>
            </c1:C1FlexGrid.Columns>
        </c1:C1FlexGrid>
    </Grid>
</UserControl>
