Xceed Toolkit Plus for WPF v5.1 Documentation
Xceed.Wpf.DataGrid.Toolkit Assembly / Xceed.Wpf.DataGrid Namespace / DataGridGroupDescription Class
Members Example


In This Topic
    DataGridGroupDescription Class
    In This Topic
    Class that describes the grouping of items using a property name as the criteria.
    Syntax
    'Declaration
     
    Public Class DataGridGroupDescription 
       Inherits System.ComponentModel.GroupDescription
    'Usage
     
    Dim instance As DataGridGroupDescription
    public class DataGridGroupDescription : System.ComponentModel.GroupDescription 
    Remarks

    This class is used by the DataGridCollectionView class to group items; however, it can also be used by the standard CollectionView class.

    The use of the GroupNames property is not supported by the DataGridGroupDescription class.

    Example
    All examples in this topic assume that the grid is bound to the Orders table of the Northwind database, unless stated otherwise. See also examples in GroupNameFromItem method.
    The following example demonstrates how to group the data items by the ShipCountry and ShipCity columns.
    <Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">
      <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:DataGridGroupDescription PropertyName="ShipCity"/>
         </xcdg:DataGridCollectionViewSource.GroupDescriptions>
        </xcdg:DataGridCollectionViewSource>
      </Grid.Resources>
       
      <xcdg:DataGridControl x:Name="OrdersGrid"
                            ItemsSource="{Binding Source={StaticResource cvs_orders}}">     
      </xcdg:DataGridControl>
    </Grid>
    Inheritance Hierarchy

    System.Object
       System.ComponentModel.GroupDescription
          Xceed.Wpf.DataGrid.DataGridGroupDescription

    Public Constructors
     NameDescription
    Public ConstructorOverloaded.   
    Top
    Public Properties
     NameDescription
    Public Property (Inherited from System.ComponentModel.GroupDescription)
    Public PropertyGets or sets the group configuration that will be applied to the groups created by this group description.  
    Public Property (Inherited from System.ComponentModel.GroupDescription)
    Public PropertyGets or sets the name of the property that is used to determine which group an item belongs to.  
    Public PropertyGets or sets the data comparer that will be used to sort the groups in a grid.  
    Public Property (Inherited from System.ComponentModel.GroupDescription)
    Top
    Public Methods
     NameDescription
    Public MethodOverridden. Retrieves the group name for the specified item.  
    Public MethodOverridden. Returns a value indicating whether the group name and the item name match, which means that the item belongs to the group.  
    Top
    Protected Methods
     NameDescription
    Protected MethodRetrieves the property value for the specified item.  
    Protected Method (Inherited from System.ComponentModel.GroupDescription)
    Top
    Protected Events
    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