Hi together,
once I export my data from the web data grid I get the following error:
System.NotSupportedException: 'Newtonsoft.Json.Linq.JValue is not a supported cell value type.'
I bind my data to the grid in the following way:
wgWorf.DataSource = JsonConvert.DeserializeObject(myJsonData);wgWorf.DataBind();
The data is shown in the grid fine, here I do not have any problems. Thats the way how I try to export the data:
this.wwExcelExporter.DataExportMode = DataExportMode.AllDataInDataSource;this.wwExcelExporter.DownloadName = "Test";this.wwExcelExporter.Export(wgWorf);
When code passes Export function the error occurs.
What am I do wrong here?
Alex
Hello linksaussen,
The exception is firing because you are not using one of the WebDataGrid supported data sources and thus there is no way for the grid to recognize the values you are setting. In order to bind and export the grid afterwards, you should describe the object model. For reference: https://www.newtonsoft.com/json/help/html/DeserializeObject.htm
I am attaching a runnable code sample illustrating how to achieve this using northwind json.
I expect it will put you on the right track.