Back to Devexpress

DataSourceFillErrorEventHandler Delegate

corelibraries-devexpress-dot-dataaccess-8d715a8f.md

latest2.6 KB
Original Source

DataSourceFillErrorEventHandler Delegate

References the method that handles the JsonDataSource.FillError event.

Namespace : DevExpress.DataAccess

Assembly : DevExpress.DataAccess.v25.2.dll

NuGet Package : DevExpress.DataAccess

Declaration

csharp
public delegate void DataSourceFillErrorEventHandler(
    object sender,
    DataSourceFillErrorEventArgs e
);
vb
Public Delegate Sub DataSourceFillErrorEventHandler(
    sender As Object,
    e As DataSourceFillErrorEventArgs
)

Parameters

NameTypeDescription
senderObject

The event source.

| | e | DataSourceFillErrorEventArgs |

The event data.

|

Example

The code sample below creates a new data source, handles the FillError event to to process exceptions, and tries to populate the data source with data.

csharp
using DevExpress.DataAccess;
using DevExpress.DataAccess.Json;
// ...
// Create a new JSON source.
var jsonSource = new UriJsonSource() {
    Uri = new Uri(@"https://invalid.json")
};
// Assign the JSON source to the data source.
var datasource = new JsonDataSource() {
    JsonSource = jsonSource
};
datasource.FillError += (s, e) => {
    e.Handled = true;
    // Add code that handles the data source fill error here.
};
vb
Imports DevExpress.DataAccess
Imports DevExpress.DataAccess.Json
' ...
' Create a new JSON source.
Dim jsonSource = New UriJsonSource() With {.Uri = New Uri("https://invalid.json")}
' Assign the JSON source to the data source.
Dim datasource = New JsonDataSource() With {.JsonSource = jsonSource}
AddHandler datasource.FillError, Sub(s, e)
                                     e.Handled = True
                                     ' Add code that handles the data source fill error here.
                                 End Sub

See Also

FillError

Fill()

DevExpress.DataAccess Namespace