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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to load SfDataGrid dynamically with JSON data without POCO classes ?

Platform: Xamarin.Forms |
Control: SfDataGrid |
Published Date: July 6, 2017 |
Last Revised Date: July 7, 2017 |
Product Version:


JSON data cannot be bound directly to SfDataGrid. To bind SfDataGrid with JSON data, we must deserialize the JSON data to a bindable format. You can use the open source NuGet Newtonsoft.Json to serialize and deserialize JSON objects.

Xamarin.Forms have limitations in loading dynamic object (Expando object). Hence dynamic objects can be loaded only using dictionary collection. Refer the dynamic limitations for more details.

JSON data can be parsed into a dictionary collection using JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(json_object).

You can then convert the list of dictionary objects to an observable collection if your data source need to respond to collection changes.

The List of Dictionary objects or the converted ObservableCollection can now be binded as ItemsSource of SfDataGrid.

Refer the below example in which the list of dictionary objects are converted as an ObservableCollection and bound to SfDataGrid.






You can set the deserialized data to the SfDataGrid by using the below



Note: In order to apply sorting for JSON data, you have to customize the GridQueryableCollectionViewWrapper class and initialize the customized GridQueryableCollectionViewWrapper while setting the ItemSource to SfDataGrid.

Refer the below code example to customize the GridQueryableCollectionViewWrapper class.




Sample Link: How to load SfDataGrid dynamically with JSON data without POCO classes?


2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
You must log in to leave a comment
Martin Richter
Jan 25, 2018

I just tried to rebuild the sample with the latest VS-2017 version and the latest Syncfusion but I get an Null pointer exception in code I have no access to

Here an extract of the stacktrace.

  0xFFFFFFFFFFFFFFFF in System.Diagnostics.Debugger.Mono_UnhandledException_internal C# Annotated Frame
  0x1 in System.Diagnostics.Debugger.Mono_UnhandledException C# Annotated Frame
  0x3E in object.4b5b9e32-61ea-4e96-aced-47f0a4743d4e C# Annotated Frame
  0x94 in Syncfusion.SfDataGrid.XForms.SfDataGrid.CreateCollectionViewAdv C# Annotated Frame
  0xA in Syncfusion.SfDataGrid.XForms.SfDataGrid.CreateCollectionView C# Annotated Frame
  0x2 in Syncfusion.SfDataGrid.XForms.SfDataGrid.SetSourceList C# Annotated Frame

Martin Richter
Jan 25, 2018

I also moved the files into a new project. Same problem.

Martin Richter
Jan 25, 2018

Removing the QueryableViewExt, got the sample to run. But I would be happy to get a full running version.

Pranay Deep
Apr 23, 2018

Sorting is not working

Érik Vinícius
Sep 17, 2019

Can't I edit DataGrid data when loading it dynamically? I've tried but everytime I change a field content it becomes the same it was before.

Walter Robert Ditzler
Dec 03, 2020


same here - example works basically except the sorting part. implemented as well QueryableViewExt but it seems Expression<Func<string, ... is not going to be fired.

Any update on this

cheers Walter.

Amir H
Dec 08, 2020

It works well using GridTextColumn but how can I use GridTemplateColumn and set a label text binding?


Please sign in to access our KB

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

Up arrow icon

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