CollectionViewSource.GetDefaultView Method

Returns the default view for the given source.

Namespace:  System.Windows.Data
Assembly:  PresentationFramework (in PresentationFramework.dll)

'Declaration
Public Shared Function GetDefaultView ( _
	source As Object _
) As ICollectionView

Parameters

source
Type: System.Object

An object reference to the binding source.

Return Value

Type: System.ComponentModel.ICollectionView
Returns an ICollectionView object that is the default view for the given source collection.

This default view is never affiliated with any CollectionViewSource objects.

All collections have a default CollectionView. WPF always binds to a view rather than a collection. If you bind directly to a collection, WPF actually binds to the default view for that collection. This default view is shared by all bindings to the collection, which causes all direct bindings to the collection to share the sort, filter, group, and current item characteristics of the one default view. Alternatively, you can create a view of your collection in Extensible Application Markup Language (XAML) or code using the CollectionViewSource class, and binding your control to that view. For an example, see How to: Sort and Group Data Using a View in XAML.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft