Hello.
Let's say that I have a grid to show my invoices including their lines.
The invoice would be something like
public class Invoice
{
public int Id {get; set;}
public string InvoiceNumber {get; set;}
public string Name {get; set;}
public DateTime InvoiceDate {get; set;}
public decimal Amount {get; set;}
}
public class InvoiceLine
{
public int Id {get; set;}
public int InvoiceId {get; set;}
public int LineOrder {get; set;}
public string Description {get; set;}
public decimal Amount {get; set;}
}
As result of the query I get a ViewModel like this which will be the datasource for the grid:
public class InvoiceViewModel
{
public int InvoiceId {get; set;}
public string InvoiceNumber {get; set;}
public string Name {get; set;}
public DateTime InvoiceDate {get; set;}
public decimal Total {get; set;}
public int LineId {get; set;}
public int LineOrder {get; set;}
public string Description {get; set;}
public decimal LineAmount {get; set;}
}
I'd like the Invoice fields of my ViewModel to act as a unique grouping condition. I don't want to group by Invoice number, then by Date, then by name, and so on.
I want to have in the same line (with different styling) the InvoiceNumber, Date, Name and Amount. Something like the following image;
Thanks for the assistance