Dynamically generated grid
-
Wednesday, October 10, 2012 4:19 PM
Hi
I want to read a number of items from an SQL database.
Each read goes through a WCF web service.
The return is a list of <string1><string2>
For all intents, string1 is the column name and string2 is the value.
Now the fun part is each item from the SQL database can have a different set of <string1> values, ie different columns names.
I want to generate some sort of datagrid that can add new columns as each new item is read in from the SQL. This means of course there may be some "rows" that have already been added, from previous reads, that do not have values for the columns being added.
In effect, the DataGrid "grows" not only by adding new rows but adding new columns during runtime.
Every example I have seen so far requires all column names are discovered before adding rows of data.
I presume each new cell of data per row would be added individually. E.g: [ if column does not exist, add it; either way: add cell data ]
Any suggestions?
Boyd

