![]() |
Prerequisite Knowledge Basic Concepts: Object Model Overview |
![]() |
Programmatically, when the DataGridCollectionView is bound to a data source, the ItemProperties.Clear method must be called prior to adding DataGridItemProperty objects to the ItemProperties collection to remove items that were automatically added when the DataGridCollectionView was instantiated. |
Grouping, Sorting, and Filtering
Detail Relations (Hierarchical Master/Detail) 
If the data source to which a DataGridCollectionView is bound contains hierarchical detail relations, the content of those relations will be displayed as the details of data items in a grid or in another detail. Relations are represented by DataGridDetailDesciptions objects and will automatically be created for:
- every DataRelation in a DataTable (DataRelationDetailDescription)
- data items that implement the IEnumerable interface (EnumerableDetailDescription)
- data items that implement the IListSource interface (ListSourceDetailDescription)
Automatic creation of detail descriptions can be disabled by setting the AutoCreateDetailDescriptions property of the DataGridCollectionViewSource to false (by default, true) or by specifying so when creating an instance of the DataGridCollectionView.
In order for the details of a data item to be displayed (and created), the parent grid or detail's AutoCreateDetailConfigurations property must be set to true (by default, false at the grid level and true for detail configurations).
![]() |
Hierarchical master/detail is only available when a grid is in a table-view layout. |
For more information on master/detail relations, refer to the DataGridDetailDescriptions Class and Detail Configuration topics.
Inserting and Editing Data Items
The DataGridCollectionView and DataGridCollectionViewSource classes expose events (see Table 1 in Inserting Data) that are triggered during key stages of inserting a new item into an underlying data source. These events provide full control over the insertion process and make it possible to insert items into a source that does not implement the IBindingLIist interface
The DataGridCollectionView also exposes the EditItem, CommitEdit, and CancelEdit methods to allow items in the underlying data source to be edited directly.
For more information on inserting and editing data, refer to the Inserting Data and Editing Data topics.
DataGridCollectionViewSource Class
The DataGridCollectionViewSource class represents the XAML proxy of the DataGridCollectionView class. The DataGridCollectionViewSource class is not a view but rather the XAML representation of the DataGridCollectionView class.
Most properties and events exposed by the DataGridCollectionView class are also exposed by the DataGridCollectionViewSource class.
![]() |
Most of the XAML examples demonstrated throughout this documentation make use of the DataGridCollectionViewSource class to provide data to a grid. |
Back to Row Class | Go to DetailDescription Class


