Xceed Toolkit Plus for WPF v4.6 Documentation
QueryItems Event (DataGridVirtualizingCollectionView)


Xceed.Wpf.DataGrid Assembly > Xceed.Wpf.DataGrid Namespace > DataGridVirtualizingCollectionView Class : QueryItems Event
Raised whenever new records are required, allowing the next batch of records to be fetched from the data source and provided to the grid. This event must be handled.
Syntax
'Declaration
 
Public Event QueryItems As EventHandler(Of QueryItemsEventArgs)
'Usage
 
Dim instance As DataGridVirtualizingCollectionView
Dim handler As EventHandler(Of QueryItemsEventArgs)
 
AddHandler instance.QueryItems, handler
public event EventHandler<QueryItemsEventArgs> QueryItems
Event Data

The event handler receives an argument of type QueryItemsEventArgs containing data related to this event. The following QueryItemsEventArgs 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.  

Gets a read only collection of DataGridGroupInfo objects, which provide information on the parent groups.

 
Remarks
New items are provided to the grid by calling the EndQuery method, which is exposed by the AsyncQueryInfo instance received in the event arguments of the QueryItems event, with an array of items. The StartIndex property of the AsyncQueryInfo indicates the index in the data source at which to start retrieving the new items while its RequestedItemCount property represents the number of new items that should be returned. The current state of the collection view (e.g., sorting and filtering) must always be taken into consideration when returning new items. If the EndQuery method is called with an array that does not match the requested item count, the collection view will automatically refresh. If the array contains a a null reference (Nothing in Visual Basic) value, an exception will be thrown.
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