Parse Ej2 Spreadsheet Control in c# (JSON)
you need to deserialize the json first:
using Newtonsoft.Json;
To get only the values you need those classes and properties otherwise you can generate the classes and properties in this link Convert Json To C# Class
public class Root1
{
public JsonObject jsonObject { get; set; }
}
public class JsonObject
{
public Workbook Workbook { get; set; }
}
public class Workbook
{
public List<Sheet> sheets { get; set; }
}
public class Sheet
{
public List<Row> rows { get; set; }
}
public class Row
{
public List<Cell> cells { get; set; }
}
public class Cell
{
public string value { get; set; }
}
To make the deserialize
private void btnConvert_Click(object sender, EventArgs e)
{
string fileName = "YOUR_PATH\\test.json";
string jsonString = File.ReadAllText(fileName);
Root1 l = JsonConvert.DeserializeObject<Root1>(jsonString);
tbResult.Text = "l.jsonObject.Workbook.sheets[0].rows[0].cells[1].value - \n" + l.jsonObject.Workbook.sheets[0].rows[0].cells[1].value;
}
and the result: