New to Telerik UI for WPF? Download free 30-day trial

Events

This topic will go through the event model exposed by RadDataServiceDataSource and the purposes for which each event can be used.

LoadingData

At this stage the data loading operation can be canceled, as the event is raised before the loading is to be executed. Also, the LoadingDataEventArgs event arguments provide information regarding the generated query which can be modified as well.

  • Cancel: Boolean property that gets or sets the value whether the event should be canceled or not.
  • Query: Property of type DataServiceQuery which can be fetched and modified.

LoadedData

This event provides various information and options regarding the processed query. The LoadedDataEventArgs event arguments inherit from the AsyncCompletedEventArgs and expose the properties listed below.

  • Cancelled: Boolean property that provides information whether an asynchronous operation has been canceled.
  • Entities: Gets all top-level entities that were loaded.
  • Error: Provides information which particular error occurred during the operation.
  • HasError: Boolean property giving information whether the operation has failed.
  • IsErrorHandled: When there is an error it can be handled through the MarkErrorAsHandled method of the event arguments. In such case the property will return True. Otherwise, it will return False.
  • TotalEntityCount: Gets the total entity count for the load operation.
  • UserState: Gets the unique identifier for the asynchronous task.

SubmittingChanges

Through this event the submitting of the made changes can be canceled. Also, the SaveChangesOptions can be modified. The event arguments are of type DataServiceSubmittingChangesEventArgs which expose the following properties.

  • Cancel: boolean property that gets or sets the value whether the event should be canceled or not.
  • SaveChangesOptions: Gets or sets the save changes options.

SubmittedChanges

The DataServiceSubmittedChangesEventArgs also inherit from the AsyncCompletedEventArgs. As an addition to them the DataServiceResponse, HasError and IsErrorHandled properties are added as well the MarkErrorAsHandled method.

  • Cancelled: Boolean property that provides information whether an asynchronous operation has been canceled.
  • DataServiceResponse: Gets the response from the service.
  • Error: Provides information which particular error occurred during the operation.
  • HasError: Boolean property giving information whether the operation has failed.
  • IsErrorHandled: When there is an error it can be handled through the MarkErrorAsHandled method of the event arguments. In such case the property will return True. Otherwise, it will return False.
  • UserState: Gets the unique identifier for the asynchronous task.

See Also

In this article