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.v24.1.dll
NuGet Packages: DevExpress.DataAccess, DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap
Declaration
[LocalizableCategory(DataAccessStringId.PropertyGridDataCategoryName)]
public int SchemaDiscoveryMaxItemCount { get; set; }
Property Value
Type | Description |
---|---|
Int32 | 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 performance for 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.
In the Data Source Wizard, you can use the IWizardJsonDataSourceSchemaDiscoveryInterceptor service to specify the SchemaDiscoveryMaxItemCount value.
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
};