We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid not supporting double/decimal fields

Thread ID:

Created:

Updated:

Platform:

Replies:

146290 Jul 30,2019 06:07 AM UTC Jul 31,2019 03:45 PM UTC Blazor 1
loading
Tags: Grid
Dominick Marciano
Asked On July 30, 2019 06:07 AM UTC

I am using a grid component and the data source is a list of a class, in which some of the fields have to be double or decimal.  However, whenever I try to use these fields I get the following error in the Chrome console:

Error: Newtonsoft.Json.JsonSerializationException: Error converting value 0.01 to type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]'. Path '', line 1, position 4. ---> System.ArgumentException: Could not cast or convert from System.Double to System.Collections.Generic.Dictionary`2[System.String,System.Object].
   at Newtonsoft.Json.Utilities.ConvertUtils.EnsureTypeAssignable(Object value, Type initialType, Type targetType)
   at Newtonsoft.Json.Utilities.ConvertUtils.ConvertOrCast(Object initialValue, CultureInfo culture, Type targetType)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize(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.BaseComponent.GetObject(Dictionary`2 Data, Type ModelType)
   at Syncfusion.EJ2.Blazor.Grids.GridTemplates.BuildRenderTree(RenderTreeBuilder builder)
   at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__5_0(RenderTreeBuilder builder)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.Rendering.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
   at Microsoft.AspNetCore.Components.Rendering.Renderer.ProcessRenderQueue()

Not sure if it matters, but I am specifying a row template and was hoping to use aggregates but I at the moment I had to make a compatible class which converts all the double/decimal values to strings.

Vignesh Natarajan [Syncfusion]
Replied On July 31, 2019 03:45 PM UTC

Hi Dominick,  

Thanks for contacting Syncfusion forum.  

Query: “I am using a grid component and the data source is a list of a class, in which some of the fields have to be double or decimal. 

As per your suggestion we have prepared a sample using Double property with Row Template and we are not able to reproduce the reported issue at our end. Kindly refer the below link for the sample  


If you are still facing the issue, kindly share additional details regarding the issue you are facing. 

  1. Share your model details.
  2. Share the Grid rendering code.
  3. Are you facing issue during the initial rendering or during certain action.
  4. Share your Syncfusion Nuget version.
  5. If possible try to reproduce the reported issue in provided sample.
  6. Kindly ensure that you have referred the latest version of Nuget , script and Css files.  

Requested details will be helpful for us to validate the reported issue at our end and provide the solution as early as possible.  

Regards, 
Vignesh Natarajan. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon