I have the following scenario: (NOTE: this is just a simplified example of my data schema)
I have a list of Orders. Each Order has a list of OrderDetails. Each OrderDetail has a type. I want to display a grid that shows for each order each OrderDetail.Type as a column.
So you have what would look like this: (Keep in mind that there are other detailtypes that are not used e.g. Type 2, 4, 5 and that new detailtypes can be created)
Order1
-> Detail1.Type = "Type 1" Detail1.Value = "Value for Detail 1 Type 1"
-> Detail2.Type = "Type 3" Detail2.Value = "Value for Detail 2 Type 3"
-> Detail3.Type = "Type 6" Detail3.Value = "Value for Detail 3 Type 6"
Order2
-> Detail1.Type = "Type 1" Detail1.Value = "Value for Detail 1 Type 1"
-> Detail2.Type = "Type 6" Detail2.Value = "Value for Detail 2 Type 6"
Order 3
-> Detail1.Type = "Type 3" Detail1.Value = "Value for Detail 1 Type 3"
I want to show a column for each detail type used in any orderdetail for any order. Also, there is no fixed list of these types because new orderdetail types can be added. So basically I am showing my orderDetail values horizontally instead of vertically and I create a column for each detailtype that exists in any orderdetail of an order even though some orders will not necessarily have a orderdetail with one of the types.
NOTE: A type can only be in one orderdetail per order.
And my resulting Grid should look like this:
Order | Type 1 | Type 3 | Type 6 |
1 Value for Detail 1 Type 1 Value for Detail 2 Type 3 Value for Detail 3 Type 6
2 Value for Detail 1 Type 1 Value for Detail 2 Type 6
3 Value for Detail 1 Type 3
I have gone so far as creating a Dictionary of <Order, OrderDetail> and placed null in the OrderDetail value if it does not have a value for a type but I cannot figure out how to display this in a grid without programatically creating the grid.
Any ideas would be appreciated.
Thanks,
I have a list of Orders. Each Order has a list of OrderDetails. Each OrderDetail has a type. I want to display a grid that shows for each order each OrderDetail.Type as a column.
So you have what would look like this: (Keep in mind that there are other detailtypes that are not used e.g. Type 2, 4, 5 and that new detailtypes can be created)
Order1
-> Detail1.Type = "Type 1" Detail1.Value = "Value for Detail 1 Type 1"
-> Detail2.Type = "Type 3" Detail2.Value = "Value for Detail 2 Type 3"
-> Detail3.Type = "Type 6" Detail3.Value = "Value for Detail 3 Type 6"
Order2
-> Detail1.Type = "Type 1" Detail1.Value = "Value for Detail 1 Type 1"
-> Detail2.Type = "Type 6" Detail2.Value = "Value for Detail 2 Type 6"
Order 3
-> Detail1.Type = "Type 3" Detail1.Value = "Value for Detail 1 Type 3"
I want to show a column for each detail type used in any orderdetail for any order. Also, there is no fixed list of these types because new orderdetail types can be added. So basically I am showing my orderDetail values horizontally instead of vertically and I create a column for each detailtype that exists in any orderdetail of an order even though some orders will not necessarily have a orderdetail with one of the types.
NOTE: A type can only be in one orderdetail per order.
And my resulting Grid should look like this:
Order | Type 1 | Type 3 | Type 6 |
1 Value for Detail 1 Type 1 Value for Detail 2 Type 3 Value for Detail 3 Type 6
2 Value for Detail 1 Type 1 Value for Detail 2 Type 6
3 Value for Detail 1 Type 3
I have gone so far as creating a Dictionary of <Order, OrderDetail> and placed null in the OrderDetail value if it does not have a value for a type but I cannot figure out how to display this in a grid without programatically creating the grid.
Any ideas would be appreciated.
Thanks,