GroupDescriptor Class

[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.

Inheritance Hierarchy

System.Object
  System.Windows.DependencyObject
    System.Windows.Controls.GroupDescriptor

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

Syntax

'Declaration
Public Class GroupDescriptor _
    Inherits DependencyObject
'Usage
Dim instance As GroupDescriptor
public class GroupDescriptor : DependencyObject
public ref class GroupDescriptor : public DependencyObject
type GroupDescriptor =  
    class
        inherit DependencyObject
    end
public class GroupDescriptor extends DependencyObject

The GroupDescriptor type exposes the following members.

Constructors

  Name Description
Public method GroupDescriptor() Initializes a new instance of the GroupDescriptor class with default values.
Public method GroupDescriptor(String) Initializes a new instance of the GroupDescriptor class with the specified property path.

Top

Properties

  Name Description
Public property Dispatcher (Inherited from DependencyObject.)
Public property PropertyPath Gets or sets the public property used to group.

Top

Methods

  Name Description
Public method CheckAccess (Inherited from DependencyObject.)
Public method ClearValue (Inherited from DependencyObject.)
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetAnimationBaseValue (Inherited from DependencyObject.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Public method GetValue (Inherited from DependencyObject.)
Protected method MemberwiseClone (Inherited from Object.)
Public method ReadLocalValue (Inherited from DependencyObject.)
Public method SetValue (Inherited from DependencyObject.)
Public method ToString (Inherited from Object.)

Top

Fields

  Name Description
Public fieldStatic member PropertyPathProperty Identifies the PropertyPath dependency property.

Top

Remarks

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.

Examples

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">
        <riaControls:DomainDataSource.DomainContext>
            <domain:ProductDomainContext />
        </riaControls:DomainDataSource.DomainContext>   
        <riaControls:DomainDataSource.GroupDescriptors>
            <riaData:GroupDescriptor PropertyPath="Size" />
        </riaControls:DomainDataSource.GroupDescriptors>
    </riaControls:DomainDataSource>
    <data:DataGrid ItemsSource="{Binding Data, ElementName=source}" />
</Grid>

Thread Safety

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

See Also

Reference

System.Windows.Controls Namespace