DataTable as PropertyType, but what with SL?

DataTable as PropertyType, but what with SL?

Old forum URL:

vschaak posted on Tuesday, January 31, 2012


back in the old WinForms days I created some sort of pivot/crosstable wizard for reporting purposes. There users can choose different row- and column-dimensions and values which results in tables that can have 3 but also 15 columns, controlled by their decision. I did this by having one big property of type DataTable (the good old ado-stuff) and bind a grid to it. So far so good and no prob.

By now some parts, esp. those that are used "out in the field", of the app have been rewritten for SL and work fine. But is there any way to lift the described functionality to SL? This feature is critical, otherwise SL will be dropped in favor of using winforms, at least for "inside jobs". The main concern is that the tables structure has to be that flexible (therefore the objects properties?). Separating those reporting aspects into a different app will be denied because of fragmentation...

Any hints?



JonnyBee replied on Friday, February 03, 2012


I would expect that you could use ExpandoObjects for this instead of DataTable.

ExpandoObjects can be casted into a dictionary of <key, value>.

vschaak replied on Monday, February 06, 2012

Hi Jonny,

sounds very interesting. Since the concept of an Expando-object is new to me, I'll give it a try and check it out...
It looks as if i can fetch my BO's through a datatable (on the server/net-side) and then cast (examining the dt's structure and so on) it into an Expando object which is passed serialized over the wire, right?



Copyright (c) Marimer LLC