Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
When using the EjsDataManager:
If data set is empty (i.e. {"Items":[],"Count":0}) and a GridColumn references a DataSource, ForeignKeyField and ForeignKeyValue an error is returned in the onActionFailure
{
"ClassName": "System.ArgumentNullException",
"Message": "Value cannot be null.",
"Data": null,
"InnerException": null,
"HelpURL": null,
"StackTraceString": " at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)\r\n at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable`1 source, Func`2 selector)\r\n at Syncfusion.EJ2.Blazor.Grids.Internal.ForeignKey`1.GenerateQuery(GridColumn column, IEnumerable`1 data, Boolean fromData, Boolean needQuery)\r\n at Syncfusion.EJ2.Blazor.Grids.Internal.ForeignKey`1.GetForeignKeyData[TModel](Object data, Boolean isComplex)\r\n at Syncfusion.EJ2.Blazor.Grids.EjsGrid`1.DataProcess()",
"RemoteStackTraceString": null,
"RemoteStackIndex": 0,
"ExceptionMethod": null,
"HResult": -2147467261,
"Source": "System.Linq",
"WatsonBuckets": null,
"ParamName": "source"
}
If deleting the last record of a dataset and a GridColumn references a DataSource, ForeignKeyField and ForeignKeyValue in addition to the above error another error is thrown client side:
Uncaught (in promise) {query: e, error: Error: Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON object (e.g.…}query: e {subQuery: null, isChild: false, distincts: Array(0), queries: Array(1), key: "", …}subQuery: nullisChild: falsedistincts: []queries: [{…}]key: ""fKey: ""expands: []sortedColumns: []groupedColumns: []params: []dataManager: undefinedfromTable: undefinedsubQuerySelector: undefinedisCountRequired: undefined__proto__: Objecterror: Error: Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[System.Object]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List
Path 'Items', line 1, position 9.
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Syncfusion.EJ2.Blazor.Data.WebApiAdaptor.ProcessResponse[T](Object data, DataManagerRequest queries)
at Syncfusion.EJ2.Blazor.DataManager.ExecuteQuery[T](DataManagerRequest queries)
at Syncfusion.EJ2.Blazor.BaseComponent.DataProcess(String dataManager, String key)
at Object.endInvokeDotNetFromJS (https://localhost:44351/_framework/blazor.server.js:8:31660)
at e.
at https://localhost:44351/_framework/blazor.server.js:1:19202
at Array.forEach (
at e.invokeClientMethod (https://localhost:44351/_framework/blazor.server.js:1:19173)
at e.processIncomingData (https://localhost:44351/_framework/blazor.server.js:1:17165)
at e.connection.onreceive (https://localhost:44351/_framework/blazor.server.js:1:10276)
at WebSocket.i.onmessage (https://localhost:44351/_framework/blazor.server.js:1:38091)__proto__: Object