private void AddGridColumns(Grid grid, int numberOfMonthsToShow)
{
if (numberOfMonthsToShow < 1)
{
numberOfMonthsToShow = 1;
}
if (numberOfMonthsToShow > this.ledgerBook.Reconciliations.Count())
{
numberOfMonthsToShow = this.ledgerBook.Reconciliations.Count();
}
for (var index = 0; index < numberOfMonthsToShow + 2; index++)
{
// + 2 because we need 2 columns for the headings
grid.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
}
}