DataGridCollectionViewSource Class
See Also  Members  
Xceed.Wpf.DataGrid Assembly > Xceed.Wpf.DataGrid Namespace : DataGridCollectionViewSource Class

Represents the XAML proxy of the DataGridCollectionView class and exposes the most commonly used members of the DataGridCollectionView class.

Syntax

Visual Basic (Declaration) 
Public NotInheritable Class DataGridCollectionViewSource 
   Inherits CollectionViewSource
   Implements ISupportInitializeIWeakEventListener 
C# 
public sealed class DataGridCollectionViewSource : CollectionViewSource, ISupportInitializeIWeakEventListener  

Example

For more examples on how to provide data, refer to the Providing Data section in the documentation.

Example

Remarks

The DataGridCollectionViewSource class is not a view but rather the XAML representation of the DataGridCollectionView class, which has a View property to retrieve the underlying DataGridCollectionView, and a Source property by which the underlying data source can be retrieved.

Like the standard CollectionViewSource, the DataGridCollectionViewSource allows data items to be grouped using either the default PropertyGroupDescription or the DataGridGroupDescription (recommended) and adding them to the GroupDescriptions property. Data items can also be sorted by adding the standard SortDescription structures to the SortDescriptions property, or filtered using the Filter event.

The ItemProperties collection contains a list of DataGridItemProperty objects that can be added or removed and that contain information relative to their corresponding item (you could consider these items to be the columns that will end up in a grid). 

In addition to the native CollectionView filtering, the DataGridCollectionView and DataGridCollectionViewSource classes also support automatic filtering, which provides Excel-like end-user filtering according to the distinct values of each column. Automatic filtering can be enabled by setting the AutoFilterMode property to And or Or (by default, None), indicating whether data items will be filtered according to all or at least one of the filtering criteria defined by each column respectively.

Notes

By default, the ItemProperties collection is empty to indicate that all the items will be used to create a grid's columns. In this situation, to access the item properties, the ItemProperties collection of the underlying DataGridCollectionView, which can be accessed through the View property, must be used.

If an item is added to the ItemProperties, then both the ItemProperties collections of the DataGridCollectionViewSource and DataGridCollectionView will contain the items.

Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         System.Windows.Data.CollectionViewSource
            Xceed.Wpf.DataGrid.DataGridCollectionViewSource

Requirements

Supported Operating Systems: Windows Server 2003 Service Pack 1; Windows Vista; Windows XP Service Pack 2

See Also