Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/LocationsView.cs =================================================================== diff -u -r4b557a57e20d32dc01a1bec3ed076ee85213b069 -r42b33ba9f1cf49ebaa4da574be4d2935adab04ec --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/LocationsView.cs (.../LocationsView.cs) (revision 4b557a57e20d32dc01a1bec3ed076ee85213b069) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/LocationsView.cs (.../LocationsView.cs) (revision 42b33ba9f1cf49ebaa4da574be4d2935adab04ec) @@ -201,8 +201,8 @@ private void InitializeEventHandlers() { - dataGridViewControl.CurrentRowChanged += DataGridViewOnCurrentRowChangedHandler; - dataGridViewControl.CellValueChanged += DataGridViewCellValueChanged; + dataGridViewControl.CurrentRowChanged += DataGridViewControlOnCurrentRowChanged; + dataGridViewControl.CellValueChanged += DataGridViewControlOnCellValueChanged; illustrationPointsControl.SelectionChanged += IllustrationPointsControlOnSelectionChanged; } @@ -219,23 +219,21 @@ #region Event handling - private void IllustrationPointsControlOnSelectionChanged(object sender, EventArgs eventArgs) + private void DataGridViewControlOnCurrentRowChanged(object sender, EventArgs e) { - if (suspendAllEvents || suspendIllustrationPointsControlSelectionChanges) + if (suspendAllEvents) { return; } - var selection = illustrationPointsControl.Selection as IllustrationPointControlItem; - Selection = selection != null - ? new SelectedTopLevelSubMechanismIllustrationPoint((TopLevelSubMechanismIllustrationPoint) selection.Source, - GetIllustrationPointControlItems().Select(ipci => ipci.ClosingSituation)) - : null; + suspendIllustrationPointsControlSelectionChanges = true; + illustrationPointsControl.Data = GetIllustrationPointControlItems(); + suspendIllustrationPointsControlSelectionChanges = false; - OnSelectionChanged(); + ProvideLocationSelection(); } - private void DataGridViewCellValueChanged(object sender, DataGridViewCellEventArgs e) + private void DataGridViewControlOnCellValueChanged(object sender, DataGridViewCellEventArgs e) { if (suspendAllEvents || e.ColumnIndex != calculateColumnIndex) { @@ -245,18 +243,20 @@ UpdateCalculateForSelectedButton(); } - private void DataGridViewOnCurrentRowChangedHandler(object sender, EventArgs e) + private void IllustrationPointsControlOnSelectionChanged(object sender, EventArgs eventArgs) { - if (suspendAllEvents) + if (suspendAllEvents || suspendIllustrationPointsControlSelectionChanges) { return; } - suspendIllustrationPointsControlSelectionChanges = true; - illustrationPointsControl.Data = GetIllustrationPointControlItems(); - suspendIllustrationPointsControlSelectionChanges = false; + var selection = illustrationPointsControl.Selection as IllustrationPointControlItem; + Selection = selection != null + ? new SelectedTopLevelSubMechanismIllustrationPoint((TopLevelSubMechanismIllustrationPoint) selection.Source, + GetIllustrationPointControlItems().Select(ipci => ipci.ClosingSituation)) + : null; - ProvideLocationSelection(); + OnSelectionChanged(); } ///