I have the following classes:
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
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
Or whatever, headers can be whatever, honestly I am open to many suggestions.
Any help would be much appreciated.
Would a
TreeViewwork? It would look something like this:You could do something like this:
But yes, as pointed out, I would use properties like so: