private void PopulateCountryComboBox() { UnsubscribeToStateChanged(); countryNames = countryNames ?? ZoneGenerator.GenerateCountryIDs(); if (cboCountry.Items.Count == 0) { cboCountry.DataSource = countryNames; } SubscribeToStateChanged(); }
private void SelectCountry() { countryNames = countryNames ?? ZoneGenerator.GenerateCountryIDs(); if (cboCountry.Items.Count == 0) { cboCountry.DataSource = countryNames; } var index = countryNames.FindIndex(c => c.Contains(address.Data.Country)); if (index != -1) { cboCountry.SelectedIndex = index; } else { cboCountry.Text = address.Data.Country; } }