Xceed Toolkit Plus for WPF v4.6 Documentation
CommitItems Event (DataGridVirtualizingCollectionViewSourceBase)


Xceed.Wpf.DataGrid Assembly > Xceed.Wpf.DataGrid Namespace > DataGridVirtualizingCollectionViewSourceBase Class : CommitItems Event
Raised when a page of data that contains edited items is about to be released from memory. This event must be handled when dealing with an editable grid.
Syntax
'Declaration
 
Public Event CommitItems As EventHandler(Of CommitItemsEventArgs)
'Usage
 
Dim instance As DataGridVirtualizingCollectionViewSourceBase
Dim handler As EventHandler(Of CommitItemsEventArgs)
 
AddHandler instance.CommitItems, handler
public event EventHandler<CommitItemsEventArgs> CommitItems
Event Data

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

PropertyDescription
Gets an AsyncCommitInfo that provides information on the virtualized items to allow those that have been modified to be committed to the underlying data source.  
Gets the DataGridVirtualizingCollectionView to which the grid is bound.  
Remarks

The CommitItems event is also called once for each page with modified data when the CommitAll method of the virtualized collection view is called even if those pages are not being released from memory. By default it will be raised for each page that is about to be released from memory; however, by setting the CommitMode property to EditCommitted, this behavior can be changed to raise the CommitItems event for each item as soon as its edit process ends.

The EndCommit method of the AsyncCommitInfo instance received in the event arguments of the CommitItems event must be called when the synchronous or asynchronous update operation is completed. Until all pending commit operations are completed, the collection view will prevent theQueryItems events from being raised; therefore, it is essential that the EndCommit method be called in order to continue fetching new items once edited items have been committed. It is recommended to call the CommitAll method before the grid is unloaded so that any pending changes can be committed to the underlying data source.

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