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.
Namespace: System.Windows.Controls
Assembly: System.Windows.Controls.DomainServices (in System.Windows.Controls.DomainServices.dll)
The GroupDescriptor type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | GroupDescriptor | Initializes a new instance of the GroupDescriptor class with default values. |
![]() | GroupDescriptor(String) | Initializes a new instance of the GroupDescriptor class with the specified property path. |
| Name | Description | |
|---|---|---|
![]() | Dispatcher | (Inherited from DependencyObject.) |
![]() | PropertyPath | Gets or sets the public property used to group. |
| Name | Description | |
|---|---|---|
![]() | CheckAccess | (Inherited from DependencyObject.) |
![]() | ClearValue | (Inherited from DependencyObject.) |
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | (Inherited from Object.) |
![]() | GetAnimationBaseValue | (Inherited from DependencyObject.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetType | (Inherited from Object.) |
![]() | GetValue | (Inherited from DependencyObject.) |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | ReadLocalValue | (Inherited from DependencyObject.) |
![]() | SetValue | (Inherited from DependencyObject.) |
![]() | ToString | (Inherited from Object.) |
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"> <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>




