'Declaration Public Event CommitItems As EventHandler(Of CommitItemsEventArgs)
'Usage Dim instance As DataGridVirtualizingCollectionViewBase Dim handler As EventHandler(Of CommitItemsEventArgs) AddHandler instance.CommitItems, handler
public event EventHandler<CommitItemsEventArgs> CommitItems
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.
Property | Description |
---|---|
AsyncCommitInfo | 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. |
CollectionView | Gets the DataGridVirtualizingCollectionView to which the grid is bound. |
The CommitItems event is also called once for each page with modified data when the CommitAll method of the virtualizing 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 the QueryItems 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.
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