0

I'm implementing a WPF MVVM application.

I have the following data structures:

public class ClientOrders
{
   public DateTime OrderDate {get; set;]
   public Description {get; set;]
   public int Quantity  {get; set;]
   public decimal OrderAmount {get; set;}
}

public class Clients
{
   public string name {get; set;}
   public string address {get; set}
   public string phone {get; set;}
   public List<ClientOrders> {get; set;}
}

I would like to use a single WPF DataGrid using the MVVM pattern to display the data. The ClientOrders for each Client should be contained within a subgrid. That subgrid should be expandable/collapsible.

I would like to use the standard out-of-the-box WPF DataGrid (NO 3rd party controls). What is the best way to design/implement this? Can someone please point me to an example/tutorial?

Thanks

JohnB
  • 3,921
  • 8
  • 49
  • 99
  • Possible duplicate of [I need the Expand / Collapse for RowDetailsTemplate](http://stackoverflow.com/questions/3829137/i-need-the-expand-collapse-for-rowdetailstemplate) – ASh May 16 '17 at 14:06
  • ASh: Close, but not quite. How do I embed and wire up a subgrid, given my listed data structures? – JohnB May 16 '17 at 14:10
  • keyword: DataGrid.RowDetailsTemplate, make your own template. Expand/Collapse is already done – ASh May 16 '17 at 14:12

1 Answers1

0

What about two grids? Selected Client will specify which ClientOrders will be shown in the second grid?

Divisadero
  • 895
  • 5
  • 18