I'm trying to bind a JSON array to a datagrid in Silverlight 3. I do not get any exceptions but I do not see the column values in the datagrid. I do see the rows though, but I do not know what the binding property should be. I do not want to create a class, populate the class and the bind. That works. I do not know what columns and datatypes the json string contains. I want the datagrid to just show all columns that are present in the json object.
Following is the code
Dim J As JsonArray = JsonArray.Load(New StringReader("[{'name':'arun', 'age':26, good:true},{'name':'kumar', 'age':28, good:false}]"))
For Each JJ In J
MessageBox.Show(JJ("name")) 'This shows the proper names'
Next
Dim c = New DataGridTextColumn()
c.Binding = New Binding("name")
GridUsers.Columns.Add(c)
GridUsers.ItemsSource = J
I do see 2 rows in the grid, but the columns values are always blank. What am I missing the binding property?
Many Thanks, Arun