Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.cs =================================================================== diff -u -re981a0ccbcc6ad8f5caf7aec024afff88e231b47 -r4994cf24768a7b54149e65713433dc4543ace82c --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.cs (.../FailureMechanismResultView.cs) (revision e981a0ccbcc6ad8f5caf7aec024afff88e231b47) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.cs (.../FailureMechanismResultView.cs) (revision 4994cf24768a7b54149e65713433dc4543ace82c) @@ -43,7 +43,6 @@ where TSectionResultRow : FailureMechanismSectionResultRow where TFailureMechanism : IFailureMechanism { - protected const int SimpleAssessmentColumnIndex = 1; private readonly IObservableEnumerable failureMechanismSectionResults; private readonly Observer failureMechanismObserver; @@ -108,8 +107,9 @@ { base.OnLoad(e); AddDataGridColumns(); - BindEvents(); + DataGridViewControl.CellFormatting += HandleCellStyling; + UpdateDataGridViewDataSource(); } @@ -163,28 +163,10 @@ } /// - /// Gets data that is visualized on the row a the given . - /// - /// The position of the row in the data source. - /// The data bound to the row at index . - protected TSectionResultRow GetDataAtRow(int rowIndex) - { - return (TSectionResultRow) DataGridViewControl.GetRowFromIndex(rowIndex).DataBoundItem; - } - - /// /// Adds the columns to the view. /// protected abstract void AddDataGridColumns(); - /// - /// Binds the events to the data grid view. - /// - protected virtual void BindEvents() - { - DataGridViewControl.CellFormatting += HandleCellStyling; - } - private void RemoveSectionResultRowEvents() { sectionResultRows?.ForEachElementDo(row => @@ -207,7 +189,7 @@ private void HandleCellStyling(object sender, DataGridViewCellFormattingEventArgs e) { - TSectionResultRow row = GetDataAtRow(e.RowIndex); + var row = (TSectionResultRow) DataGridViewControl.GetRowFromIndex(e.RowIndex).DataBoundItem; if (row.ColumnStateDefinitions.ContainsKey(e.ColumnIndex)) {