Hello,
I've been searching for an answer to this question and can't find one. I've tried all sorts of things but would appreciate some help now please.
[For the sake of simplicity, I've mapped my problem onto the below example]
I have an ObservableCollection<Person> called Persons.
A Person has a property called Data. Datais just a String[
So an example of Data would be {"Michelle", "Blue Eyes", "Blonde Hair", "Petite Build"}.
Every person has exactly the same number of strings in their Features string[.
What I need to do is bind to Persons, and have it show one Person per line, and Data[0] in column 0, Data[1] in column 1etc
Is this even possible?
My current alternative involves dynamically generating the Person class such that it has properties for each of the items in Data
e.g. string Person.D1 { get { return Data[1]; } }
This would allow me to bind to D1, D2, D3 etc in the Grid.
There must be a better way?
Thanks,
Lee
Hi Josh,
Many thanks for that. I've read enough of your posts to know that you'd know the answer!
I'll ask you my other question then :-) although I'll put it in another thread with an appropriate name.
Hi Lee,
You can use UnboundFields to do this:
<igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field Name="Data" IsExpandable="False" Visibility="Collapsed" /> <igDP:UnboundField Label="Value 1" BindingPath="Data[0]" /> <igDP:UnboundField Label="Value 2" BindingPath="Data[1]" /> <igDP:UnboundField Label="Value 3" BindingPath="Data[2]" /> </igDP:FieldLayout.Fields></igDP:FieldLayout>