Question

I am trying to find a way bind Grid view to a JSON.NET parsed Linq to Json object

simply am calling

JObject yrs = SearchData("");

then use one property to be bound to Grid view

GridView1.DataSource = yrs["businesses"].Children();

I cant find any resources for something like that

neither binding directly work nor using Children, and seems like I can not find it in the documentation.

appreciate your help

Was it helpful?

Solution

I think I just needed to sleep :)

this is how it should go, if someone need that ,

        var bsn =from c in yrs["businesses"].Children() 
        select new { Title = (string)c["Title"] , Type = (string)c["Type"] };
        GridView1.DataSource = bsn;

if there are better ways please advice

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top