When using a collection view that supports data virtualization (i.e.,DataGridVirtualizingCollectionView andDataGridVirtualizingCollectionViewSource) and for which automatic filtering is enabled, theQueryAutoFilterDistinctValuesevent must be handled in order to provide the distinct values that will appear in the auto-filter control for a column as it is not possible to extrapolate the distinct values from the data source when data virtualization is used. Failure to handle this event and return the distinct values for a column when automatic filtering is enabled will result in an empty auto-filter control.
The distinct values that are returned for a column do not necessarily have to match the data type of the items contained in the column; however, they must take into consideration and sorting and filtering criteria that are currently applied.
Requirements
Target Platforms: Windows 11, Windows, 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2