Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Merge/AssessmentSectionMergeDataProviderDialog.Designer.cs =================================================================== diff -u -r1a5caec983007983dfc4a1b7d8b12d30c8cdc1ea -r60ac24f24bd12579564f312eb215a6dd0d193ed5 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Merge/AssessmentSectionMergeDataProviderDialog.Designer.cs (.../AssessmentSectionMergeDataProviderDialog.Designer.cs) (revision 1a5caec983007983dfc4a1b7d8b12d30c8cdc1ea) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Merge/AssessmentSectionMergeDataProviderDialog.Designer.cs (.../AssessmentSectionMergeDataProviderDialog.Designer.cs) (revision 60ac24f24bd12579564f312eb215a6dd0d193ed5) @@ -102,7 +102,6 @@ resources.ApplyResources(this.assessmentSectionComboBox, "assessmentSectionComboBox"); this.assessmentSectionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.assessmentSectionComboBox.Name = "assessmentSectionComboBox"; - this.assessmentSectionComboBox.SelectedIndexChanged += new System.EventHandler(this.AssessmentSectionComboBox_OnSelectedIndexChanged); // // tableLayoutPanelForLabel // Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Merge/AssessmentSectionMergeDataProviderDialog.cs =================================================================== diff -u -re5dda4058c572ba943002d130b8591a90ee19ce9 -r60ac24f24bd12579564f312eb215a6dd0d193ed5 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Merge/AssessmentSectionMergeDataProviderDialog.cs (.../AssessmentSectionMergeDataProviderDialog.cs) (revision e5dda4058c572ba943002d130b8591a90ee19ce9) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Merge/AssessmentSectionMergeDataProviderDialog.cs (.../AssessmentSectionMergeDataProviderDialog.cs) (revision 60ac24f24bd12579564f312eb215a6dd0d193ed5) @@ -78,7 +78,7 @@ throw new ArgumentException($@"{nameof(assessmentSections)} must at least have one element.", nameof(assessmentSections)); } - assessmentSectionComboBox.DataSource = assessmentSections.ToArray(); + SetComboBoxData(assessmentSections); if (ShowDialog() == DialogResult.OK) { @@ -119,6 +119,7 @@ private void InitializeComboBox() { assessmentSectionComboBox.DisplayMember = nameof(AssessmentSection.Name); + assessmentSectionComboBox.SelectedIndexChanged += AssessmentSectionComboBoxOnSelectedIndexChanged; } private void InitializeDataGridView() @@ -153,7 +154,7 @@ #region Event Handling - private void AssessmentSectionComboBox_OnSelectedIndexChanged(object sender, EventArgs eventArgs) + private void AssessmentSectionComboBoxOnSelectedIndexChanged(object sender, EventArgs eventArgs) { if (assessmentSectionComboBox.SelectedIndex == -1) { @@ -167,6 +168,12 @@ #region Data Setters + private void SetComboBoxData(IEnumerable assessmentSections) + { + assessmentSectionComboBox.DataSource = null; + assessmentSectionComboBox.DataSource = assessmentSections.ToArray(); + } + private void SetDataGridViewData(AssessmentSection assessmentSection) { failureMechanismMergeDataRows = new[]