Xceed Toolkit Plus for WPF v5.0 Documentation
In This Topic
    Changing the group-header text
    In This Topic

    The following example demonstrates how to change the information displayed in each GroupHeaderControl by creating an implicit DataTemplate targeting the Group data type.

    XAML
    Copy Code
    <Grid>
      <Grid.Resources>
        <xcdg:DataGridCollectionViewSource x:Key="cvs_orders"
                                           Source="{Binding Source={x:Static Application.Current},
                                                            Path=Orders}">
          <xcdg:DataGridCollectionViewSource.GroupDescriptions>
            <xcdg:DataGridGroupDescription PropertyName="ShipCountry"/>
          </xcdg:DataGridCollectionViewSource.GroupDescriptions>
        </xcdg:DataGridCollectionViewSource>
        <DataTemplate DataType="{x:Type xcdg:Group}">
          <StackPanel Orientation="Horizontal">
            <TextBlock Text="The "/>
            <TextBlock Text="{Binding Value}"/>
            <TextBlock Text=" group contains "/>
            <TextBlock Text="{Binding Items.Count}"/>
            <TextBlock Text=" items."/>
          </StackPanel>
        </DataTemplate>
      </Grid.Resources>
      <xcdg:DataGridControl x:Name="OrdersGrid"
                            ItemsSource="{Binding Source={StaticResource cvs_orders}}"/>
    </Grid>