| Visual Basic (Declaration) | |
|---|---|
Public NotInheritable Class DataGridCollectionView Inherits DataGridCollectionViewBase Implements ICollection, IEnumerable, IList, INotifyCollectionChanged, IBindingList, ICancelAddNew, ICollectionView, IEditableCollectionView, IItemProperties, INotifyPropertyChanged, ISupportInitialize, ISupportInitializeNotification, IWeakEventListener | |
| C# | |
|---|---|
public sealed class DataGridCollectionView : DataGridCollectionViewBase, ICollection, IEnumerable, IList, INotifyCollectionChanged, IBindingList, ICancelAddNew, ICollectionView, IEditableCollectionView, IItemProperties, INotifyPropertyChanged, ISupportInitialize, ISupportInitializeNotification, IWeakEventListener | |
Contrary to the BindingListCollectionView class, the DataGridCollectionView class will never touch the underlying data source, meaning that the original sorting and filtering present in the data source will not be modified. When sorting, the DataGridCollectionView class also provides an estimated 20% increase in performance. In addition to the sorting speed, a limited number of "resets" make the DataGridCollectionView class a better choice when performance is of the utmost importance.
A DataGridItemProperty will be created for each property in the underlying data source and can be retrieved through the ItemProperties property of the DataGridCollectionView.
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.
Programmatically, 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.
System.Object
System.Windows.Threading.DispatcherObject
System.Windows.Data.CollectionView
Xceed.Wpf.DataGrid.DataGridCollectionViewBase
Xceed.Wpf.DataGrid.DataGridCollectionView
Supported Operating Systems: Windows Server 2003 Service Pack 1; Windows Vista; Windows XP Service Pack 2


~326.gif)


~326.gif)

~326.gif)

~326.gif)
