Let's say I have the following two classes:
public class TestResults
{
public string TestGroup {get; set; }
public string TestName {get; set; }
public bool TestPassed {get; set; }
}
public class TestSummary
{
public string TestGroup {get; set; }
public string SummaryText {get; set; }
}
Some of the test data I have may look like this:
TestResults
TestGroup TestName TestPassed
==========================================
Item1 HasPrice True
Item1 HasDiscount True
Item2 HasPrice True
Item2 HasDiscount False
TestSummary
TestGroup SummaryText
=================================================
Item1 SKU: 234 Price: 13.40 Discount: 1.34
Item2 SKU: 345 Pirce: 15.70
If I have one IEnumerable<TestResults>with IEnumerable<TestSummary>, I would like to be able to group them together on TestGroupand display their information something like this:
______________________________________________________________________
| Item1 _________________________ _______________________________ |
| | Grid of TestResults | | SummaryText for Item1 | |
| |_______________________| |______________________________| |
|_____________________________________________________________________|
______________________________________________________________________
| Item2 _________________________ _______________________________ |
| | Grid of TestResults | | SummaryText for Item2 | |
| |_______________________| |______________________________| |
|_____________________________________________________________________|
I have 2 questions on how to do this:
- How can I join two
IEnumerableand group them together so that they can be used with datatemplate? - Can my data template look like it displays grouped data?
source
share