VirtualServerModeSource.ConfigurationChanged Event
Fires on initial data load and reload in the bound grid control, and when the data grid’s sort and filter configuration changes. Allows you to initialize the data source and (optionally) return an initial batch of records.
Namespace: DevExpress.Data
Assembly: DevExpress.Data.v19.1.dll
Declaration
Event Data
The ConfigurationChanged event's data class is VirtualServerModeRowsEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
CancellationToken | Gets a token that allows you to respond to a task cancellation request invoked by the grid control. |
ConfigurationInfo | Gets information on the grid’s current sorting, filtering and summary configuration. |
CurrentRowCount | Gets the count of rows currently loaded to the grid. |
RowsTask | Gets or sets the task that returns requested rows. |
UserData |
Read this parameter to get custom data passed from the previously called Task or ConfigurationChanged event handler. When handling the VirtualServerModeSource.ConfigurationChanged event, set the UserData event parameter to pass custom data to a subsequent VirtualServerModeSource.MoreRows event handler (unless you specify the RowsTask event parameter). |
Remarks
The ConfigurationChanged event fires in the following cases:
- data load on startup
- data reload (e.g., when calling the GridControl.RefreshDataSource method)
- when the data grid’s sort and filter configuration changes.
The ConfigurationChanged event allows you prepare your data for the load in the grid control, and optionally provide an initial batch of rows. To provide a batch of rows, create a Task that will return requested rows, and assign this task to the RowTask event parameter. To provide subsequent batches of rows (when required), handle the VirtualServerModeSource.MoreRows event.
You can provide an initial and subsequent batches of rows by handling a single event - VirtualServerModeSource.MoreRows. In this case, if you handle the ConfigurationChanged event, leave the event’s RowTask parameter set to null.
Tip
A Task typically executes asynchronously. To return a batch of rows synchronously, create the task with the Task.FromResult method (available in .NET Framework 4.5+).