Hello,
We are integrating with an existing service that returns 2 meaningful pieces of information (for this discussion):
1) A '\t' separated string of column headers (can vary in number and values)
2) An array of '\t' separated strings of values (tab delineation of individual records matches column headers)
I already know that I can use string.Split('\t') to get arrays of strings whose indices are aligned correctly with the column header indices, so parsing the response is not an issue.
I know that I can write a conversion method to get this into a well-formatted xml document, then bind to the xamDataGrid. What I was hoping is that there would be a good way to do this using objects so that accessing the data for business logic would be simplified.
Do you know a good way to take the data we are given and build up objects that will not only be able to bind to the xamDataGrid, but also be usable throughout our business logic?
Thank you,
Mike
Hello Mike,
I have been looking into your question.
I have been further investigating your issue. If you want to convert an array to a List of strings or objects(for example) I can suggest to take a look at the following links: http://stackoverflow.com/questions/4922129/how-do-i-convert-an-array-to-a-listobject-in-c ,
http://stackoverflow.com/questions/703762/populate-list-from-array ,
http://stackoverflow.com/questions/10129419/convert-array-of-strings-to-liststring ,
http://stackoverflow.com/questions/12948306/how-to-convert-an-array-of-objects-to-list .
Please do not hesitate to let me know if you have any further questions on this matter or I have misunderstood your requirements.
I know how to take string data and use it in different ways already. My problem is having unknown sets of data that need to be displayed in a xamDataGrid. Instead of focusing on the string aspect of this issue, let's say that we have a 1 to n numbered list of Dictionary objects. These dictionaries are structured with the column headers as keys and column values as values. We need to have the xamDataGrid generate column names from the keys and fill in all of the row data based on each dictionary's values.
Our fallback is to turn the data into an XDocument that we can use the xamDataGrid's xml binding capabilities to display; the problem here is the performance and costs of generating this xml.