Thank you. This would most likely work if I wasn't using a JObject with unknown attributes.
I am converting objects from the database into JObjects (dynamic objects) to the grid.
I get a Json back in the to the ds.Value and convert it to a string...
The problem arises at this line
currentData = JsonConvert.DeserializeObject<IEnumerable<JObject>>(str);
i get an error stating that I cannot convert a JsonArray :
Newtonsoft.Json.JsonSerializationException: 'Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.IEnumerable`1[Newtonsoft.Json.Linq.JObject]' 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<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
Path 'dataSource', line 1, position 14.'
I have tried to convert to a JsonArray, to Serialize and Deserialize twice... and various other options I have found online, but nothing seems to be working.
I am hoping someone maybe ran into this issue before and a there could be a solution in how to deseralize the returned datasource into a list of JObjects. Hopefully this is one of my issues.