GroupDescriptor Class

WCF RIA Services

[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]

Describes a grouping criterion.


Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls.DomainServices (in System.Windows.Controls.DomainServices.dll)

Public Class GroupDescriptor _
	Inherits DependencyObject
Dim instance As GroupDescriptor

The GroupDescriptor type exposes the following members.

Public methodGroupDescriptorInitializes a new instance of the GroupDescriptor class with default values.
Public methodGroupDescriptor(String)Initializes a new instance of the GroupDescriptor class with the specified property path.

Public propertyDispatcher (Inherited from DependencyObject.)
Public propertyPropertyPathGets or sets the public property used to group.

Public methodCheckAccess (Inherited from DependencyObject.)
Public methodClearValue (Inherited from DependencyObject.)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetAnimationBaseValue (Inherited from DependencyObject.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodGetValue (Inherited from DependencyObject.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodReadLocalValue (Inherited from DependencyObject.)
Public methodSetValue (Inherited from DependencyObject.)
Public methodToString (Inherited from Object.)

Public fieldStatic memberPropertyPathPropertyIdentifies the PropertyPath dependency property.

The DomainDataSource class provides the GroupDescriptors collection to facilitate grouping data by property values. In the GroupDescriptors collection, you add GroupDescriptor instances that define the value to use for grouping. You can add as many GroupDescriptor instances as needed.

If you use GroupDescriptor programmatically, verify that the CanLoad property returns true. Attempting to group when CanLoad returns false, causes the DomainDataSource to throw an invalid operation exception. Grouping initiates a load operation, and load operations are not permitted when CanLoad is false.

The following example shows how to add a value to use for grouping.

<Grid x:Name="LayoutRoot" Background="White">  
    <riaControls:DomainDataSource x:Name="source" QueryName="GetProducts" AutoLoad="true">
            <domain:ProductDomainContext />
            <riaData:GroupDescriptor PropertyPath="Size" />
    <data:DataGrid ItemsSource="{Binding Data, ElementName=source}" />

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.