Skip to main content
A newer version of this page is available. .

JsonDataSource.Fill() Method

Populates the JsonDataSource object with JSON data.

Namespace: DevExpress.DataAccess.Json

Assembly: DevExpress.DataAccess.v20.2.dll

NuGet Packages: DevExpress.DataAccess, DevExpress.WindowsDesktop.DataAccess

Declaration

public void Fill()

Remarks

Use the Fill method to populate the JsonDataSource with data.

If you did not define the data source schema, the data source is populated with all data available from the source.

The JsonDataSourceException exception occurs if the Fill method failed to populate the data source. Catch this exception or handle the FillError event to ensure that the Fill method has completed successfully.

Example

The code sample below creates a JSON data source and populates it with data from the endpoint.

using DevExpress.DataAccess.Json;
// ...
// Create a new JSON data source and populate it with data.
var jsonDataSource = new JsonDataSource();
jsonDataSource.JsonSource = new UriJsonSource() {
    Uri = new Uri(@"https://raw.githubusercontent.com/DevExpress-Examples/DataSources/master/JSON/customers.json")
};
jsonDataSource.Fill();

The following code snippets (auto-collected from DevExpress Examples) contain references to the Fill() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also