Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismResultView.cs =================================================================== diff -u -rd49a06fcbf63b36885b0d8f09a01f6539bcbfd56 -r3af4966b460f479dba1acd47805152617af8a77b --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismResultView.cs (.../HeightStructuresFailureMechanismResultView.cs) (revision d49a06fcbf63b36885b0d8f09a01f6539bcbfd56) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismResultView.cs (.../HeightStructuresFailureMechanismResultView.cs) (revision 3af4966b460f479dba1acd47805152617af8a77b) @@ -26,6 +26,7 @@ using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Structures; +using Ringtoets.Common.Forms.Helpers; using Ringtoets.Common.Forms.Views; using Ringtoets.HeightStructures.Data; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; @@ -37,6 +38,8 @@ /// public class HeightStructuresFailureMechanismResultView : FailureMechanismResultView { + private const int assessmentLayerOneColumnIndex = 1; + private const int assessmentLayerTwoAIndex = 2; private readonly RecursiveObserver calculationInputObserver; private readonly RecursiveObserver calculationOutputObserver; private readonly RecursiveObserver calculationGroupObserver; @@ -46,6 +49,7 @@ /// public HeightStructuresFailureMechanismResultView() { + DataGridViewControl.AddCellFormattingHandler(ShowAssessmentLayerErrors); DataGridViewControl.AddCellFormattingHandler(DisableIrrelevantFieldsFormatting); // The concat is needed to observe the input of calculations in child groups. @@ -83,6 +87,7 @@ protected override void Dispose(bool disposing) { + DataGridViewControl.RemoveCellFormattingHandler(ShowAssessmentLayerErrors); DataGridViewControl.RemoveCellFormattingHandler(DisableIrrelevantFieldsFormatting); calculationInputObserver.Dispose(); @@ -117,7 +122,7 @@ private void DisableIrrelevantFieldsFormatting(object sender, DataGridViewCellFormattingEventArgs eventArgs) { - if (eventArgs.ColumnIndex > 1) + if (eventArgs.ColumnIndex > assessmentLayerOneColumnIndex) { if (HasPassedLevelOne(eventArgs.RowIndex)) { @@ -129,5 +134,25 @@ } } } + + private void ShowAssessmentLayerErrors(object sender, DataGridViewCellFormattingEventArgs e) + { + if (e.ColumnIndex != assessmentLayerTwoAIndex) + { + return; + } + + var resultRow = (HeightStructuresFailureMechanismSectionResultRow) GetDataAtRow(e.RowIndex); + if (resultRow != null) + { + DataGridViewCell currentDataGridViewCell = DataGridViewControl.GetCell(e.RowIndex, e.ColumnIndex); + StructuresCalculation normativeCalculation = resultRow.GetSectionResultCalculation(); + + FailureMechanismSectionResultRowHelper.ShowAssessmentLayerTwoAErrors(currentDataGridViewCell, + resultRow.AssessmentLayerOne, + resultRow.AssessmentLayerTwoA, + normativeCalculation); + } + } } } \ No newline at end of file