void OnPopulationProviderChanged() { if (_populationProvider != null) { SuspendLayout(); var tallyPopulations = _populationProvider.GetFixCNTTallyPopulations(); int rowCounter = 0; foreach (var pop in tallyPopulations) { var tallyRow = new FixCntTallyRow(pop, this); tallyRow.Dock = DockStyle.Top; if (rowCounter++ % 2 == 0) { tallyRow.BackColor = SystemColors.ControlDark; } this.Controls.Add(tallyRow); } ResumeLayout(false); } }