Unable to display a List<MyClass> as one of the columns of my view
I have the following classes:
Code:
public class Order
{
public string OrderName { get; set; }
public List<Parts> PartsList { get; set; }
}
public class Parts
{
public string PartName { get; set; }
public double PartQuantity { get; set; }
}
In my code I create a list of Order objects
Code:
List<Order> myOrders;
I would like to display all of this to the user somehow, like using a stack panel of elements where the first is a TextBox to display OrderName and the second is a Datagrid to display the list of Parts?
Honestly I am trying many different things (I have no requirements on what type of controls to use) but I can never get the PartsList to show correctly (either I get nothing OR I get "Collection" show to the user.
The goal would be to see something like this:
....Order1....Part1 7
..................Part2 12
....Order2....Part1 100
..................Part2 1
..................Part3 58
(dots are only there because spacing was off, should be spaces)
Any help would be much appreciated.
Thanks,