Hi!
I need some design advice on the implementation of Silverlight controls.
I have the requirement to build a grid where "all" the properties and behaviour is dynamic, and based on data which is received from a web-service.
I already have in place (from a previous ASP.NET project) a stored procedure which returns two result-sets:
* The actual data, which could be any set of columns as well as number of rows
* The metadata which describes the looks and behaviour for the actual data.
Examples of metadata:
- "Hidden". Decides if a certain column should be shown in the grid.
- "Paging". Decides if paging should be used, pagesize, etc
- "SelectedItem". Decides which items in the grid which should be selected when the grid initially is loaded.
- "StyleColumn". Specifies, for a certain column, which other column contains style information, such as font, color, etc
In other words, the first resultset contains the information which should be shown in the grid, the other resultset decides what it should look like.
In the current ASP.NET implementation, I have written code to apply the metadata on the ASP.NET grid. I didn't use the "Dynamic data framework", since it wasn't available when I wrote the code. (I never looked much into Dynamic Data, so I'm not sure it would be appropriate to use)
So, my question is now: How would I go about to implement this in Silverlight? I see two major design decisions:
How do I pass the data?
I understand that DataSet, DataTable, etc is not available in Silverlight. So, what would be the best way to pass, through the webservice, the resultsets retrieved from Sql Server?
How do I use metadata to control the looks/behaviour of the grid in Silverlight?
I know I can write similar code which I did in the ASP.NET version, but I would prefer to harness anything which is already in place in Silverlight. As I understand it, Dynamic Data is not available. But are there other techniques, which would be useful in my case?
Thanks!
/Fredrik