I need to achieve a result like this:
xaml doesn't allow to create row via code, so I though to implement the row logic as a list. Each list is a row.
What I did essentially is this:
LastFiveHomeAwayMatches2 = new List<List<string>>()
{
new List<string> {"Accrington", "D", "D", "W", "W", "W", "11" },
new List<string> { string.Empty, "1-1", "0-0", "0-1", "4-2", "0-3", string.Empty },
new List<string> {"Fos", "D", "D", "W", "W", "W", "11" },
new List<string> { string.Empty, "1-1", "0-0", "0-1", "4-2", "0-3", string.Empty },
};
but how can I bind this multiple list in the Datagrid to achieve the result displayed? thanks. Update
<DataGrid AutoGenerateColumns="False"
ItemsSource="{Binding MatchController.LatestFiveMatches}">
<DataGrid.Columns>
<DataGridTextColumn Header="Teams" />
<DataGridTextColumn Header="5" />
<DataGridTextColumn Header="4" />
<DataGridTextColumn Header="3" />
<DataGridTextColumn Header="2" />
<DataGridTextColumn Header="1" />
<DataGridTextColumn Header="Pt."/>
</DataGrid.Columns>
</DataGrid>
this doesn't display nothing. I need to display as header columns Teams, 5, 4, 3, 2, 1 also if the datagrid is blank.