Xceed DataGrid for WPF v7.2 Documentation
QueryAutoFilterDistinctValues Event (DataGridVirtualizingCollectionView)


Xceed.Wpf.DataGrid Assembly > Xceed.Wpf.DataGrid Namespace > DataGridVirtualizingCollectionView Class : QueryAutoFilterDistinctValues Event
Raised when an auto-filter control is open for the first time to allow the distinct values for the column to be provided.
Syntax
'Declaration
 
Public Event QueryAutoFilterDistinctValues As EventHandler(Of QueryAutoFilterDistinctValuesEventArgs)
'Usage
 
Dim instance As DataGridVirtualizingCollectionView
Dim handler As EventHandler(Of QueryAutoFilterDistinctValuesEventArgs)
 
AddHandler instance.QueryAutoFilterDistinctValues, handler
public event EventHandler<QueryAutoFilterDistinctValuesEventArgs> QueryAutoFilterDistinctValues
Event Data

The event handler receives an argument of type QueryAutoFilterDistinctValuesEventArgs containing data related to this event. The following QueryAutoFilterDistinctValuesEventArgs properties provide information specific to this event.

PropertyDescription
Gets an AsyncQueryInfo that provides the information necessary to retrieve the next batch of items.  
Gets the DataGridVirtualizingCollectionView to which the grid is bound.  
true if the event is asynchronous, otherwise false. By default, false. (Inherited from Xceed.Wpf.DataGrid.AsyncQueryEventArgs)
Gets the DataGridItemProperty for which distinct values need to be returned.  
Remarks

When using a collection view that supports data virtualization (i.e., DataGridVirtualizingCollectionView and DataGridVirtualizingCollectionViewSource) and for which automatic filtering is enabled, the QueryAutoFilterDistinctValues event 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.

When a distinct value is selected in the auto-filter control's drop down, the collection view will be reset causing the QueryItemCount and QueryItems events to be raised.

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

See Also