Xceed DataGrid for WPF v7.2 Documentation
Group Class
Members  Example 


Xceed.Wpf.DataGrid Assembly > Xceed.Wpf.DataGrid Namespace : Group Class
Represents the run-time realization of a group.
Syntax
'Declaration
 
Public NotInheritable Class Group 
'Usage
 
Dim instance As Group
public sealed class Group 
Example
All examples in this topic assume that the grid is bound to the Orders table of the Northwind database, unless stated otherwise.
The following example demonstrates how to change the information displayed in each GroupHeaderControl by creating an implicit DataTemplate targeting the Group data type.
<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>
Inheritance Hierarchy

System.Object
   Xceed.Wpf.DataGrid.Group

Requirements

Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Group Members
Xceed.Wpf.DataGrid Namespace

DataGrid Fundamentals

Grouping Data