<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="C1DataGrid_Demo2010.Grouping" d:DataContext="{d:DesignData Source=/DesignData/SampleProducts.xaml}" 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:local="clr-namespace:C1DataGrid_Demo2010" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
    <UserControl.Resources>
        <local:Models x:Name="Models" />
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <c1:C1DataGrid x:Name="grid" CanUserGroup="True" AutoGenerateColumns="True" AutoGeneratingColumn="grid_AutoGeneratingColumn" AutoGeneratedColumns="grid_AutoGeneratedColumns" BeginningNewRow="grid_BeginningNewRow" RowHeight="70" GroupRowHeight="30" FrozenColumnCount="0" Grid.Row="2" ItemsSource="{Binding}">
            <c1:C1GroupingWithSummariesBehavior.GroupingWithSummariesBehavior>
                <c1:C1GroupingWithSummariesBehavior />
            </c1:C1GroupingWithSummariesBehavior.GroupingWithSummariesBehavior>
            <c1:C1RowIndexHeaderBehavior.RowIndexHeaderBehavior>
                <c1:C1RowIndexHeaderBehavior />
            </c1:C1RowIndexHeaderBehavior.RowIndexHeaderBehavior>
        </c1:C1DataGrid>
        <Border Margin="0 0 0 10">
            <StackPanel Orientation="Horizontal" Height="20" Margin="0,0,5,0">
                <Button x:Name="btnExpand" Padding="0" Height="20" Content="Expand All" Click="btnExpand_Click" Width="140" />
                <Button x:Name="btnCollapse" Padding="0" Height="20" Content="Collapse All" Click="btnCollapse_Click" Width="140" Margin="5,0,0,0" />
                <TextBlock Text="Group By" TextWrapping="Wrap" TextAlignment="Left" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="20,0,0,0" />
                <ComboBox x:Name="cmbColumns" Margin="6,0,0,0" HorizontalAlignment="Left" Width="140">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Header}" />
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>
            </StackPanel>
        </Border>
    </Grid>
</UserControl>