I’ve been working on a project porting ASP.Net code to Silverlight. In the old code, we had a dashboard widget to query data and return the results in a grid. It was trivial to do this with datasets – just query the data, return the dataset, then bind it to a GridView or DataGrid. The columns and rows were all automatically generated.
I’m fairly new to WCF and Silverlight, but quickly realized that WCF wanted a contract. That didn’t exactly fit our dynamic model. We tried returning the query results via WCF as an XML string, and then parsing the string into XML in Silverlight and binding to a DataGrid, but the results were not always formatted like we expected.
Finally someone on our team found a post in the Silverlight forums that was exactly what we were looking for. They basically create a few custom classes and then pull them into Silverlight as an ObservableCollection. Since it took us so long to find it, I thought I’d post it here in hopes that it helps someone else out down the road.