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

JsonDataSource.SchemaDiscoveryMaxItemCount Property

Specifies how many data source elements to analyze on each level to build the schema.

Namespace: DevExpress.DataAccess.Json

Assembly: DevExpress.DataAccess.v20.2.dll

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

Declaration

[DefaultValue(100)]
[LocalizableCategory(DataAccessStringId.PropertyGridDataCategoryName)]
public int SchemaDiscoveryMaxItemCount { get; set; }

Property Value

Type Default Description
Int32 100

The number of data source elements to analyze on each level to build the schema.

Remarks

Use this property to limit the number of data source records that the JsonDataSource uses to build the schema. This improves the performance on data sources with a large number of records.

Set this property to 0 to analyze all data source records.

If a record contains an array of nested records, the same limit applies to the nested records to build their schema.

This property is not in effect if the Schema property has a value different from null (Nothing in Visual Basic) before you call the Fill() method.

Example

The code sample below creates a new JSON data source and uses the first 5 records to build the schema.

using DevExpress.DataAccess;
using DevExpress.DataAccess.Json;
// ...
// Create a new JSON source.
var jsonSource = new UriJsonSource() {
    Uri = new Uri(@"https://raw.githubusercontent.com/DevExpress-Examples/DataSources/master/JSON/customers.json")
};
// Assign the JSON source to the data source. Use the first 5 records to build the schema.
var datasource = new JsonDataSource() {
    JsonSource = jsonSource,
    SchemaDiscoveryMaxItemCount = 5
};
See Also