Index: Core/Common/src/Core.Common.Controls/DataGrid/DataGridViewControl.cs
===================================================================
diff -u -r7b276f1a62592cea6673821b13a5261a58a12592 -reffbd5371b578307e0995b16a979ce6eced8d9a4
--- Core/Common/src/Core.Common.Controls/DataGrid/DataGridViewControl.cs (.../DataGridViewControl.cs) (revision 7b276f1a62592cea6673821b13a5261a58a12592)
+++ Core/Common/src/Core.Common.Controls/DataGrid/DataGridViewControl.cs (.../DataGridViewControl.cs) (revision effbd5371b578307e0995b16a979ce6eced8d9a4)
@@ -196,14 +196,6 @@
}
///
- /// Resets the last selected row property
- ///
- public void ResetLastSelectedRow()
- {
- lastSelectedRow = -1;
- }
-
- ///
/// Sets the currently active cell.
///
/// Sets the cell to be set active.
@@ -436,6 +428,11 @@
base.OnLoad(e);
}
+ private void ResetLastSelectedRow()
+ {
+ lastSelectedRow = -1;
+ }
+
#region Styling
///
Index: Core/Common/test/Core.Common.Controls.Test/DataGrid/DataGridViewControlTest.cs
===================================================================
diff -u -r33dbdea0e774aee06e12662ff82ce1c074a511a5 -reffbd5371b578307e0995b16a979ce6eced8d9a4
--- Core/Common/test/Core.Common.Controls.Test/DataGrid/DataGridViewControlTest.cs (.../DataGridViewControlTest.cs) (revision 33dbdea0e774aee06e12662ff82ce1c074a511a5)
+++ Core/Common/test/Core.Common.Controls.Test/DataGrid/DataGridViewControlTest.cs (.../DataGridViewControlTest.cs) (revision effbd5371b578307e0995b16a979ce6eced8d9a4)
@@ -1277,36 +1277,6 @@
}
}
- [Test]
- public void GivenFullyConfiguredDataGridView_WhenResetLastSelectedRowAndCellInSameRowSelected_ThenCurrentRowChangedEventFired()
- {
- // Given
- using (var form = new Form())
- using (var control = new DataGridViewControl())
- {
- form.Controls.Add(control);
- form.Show();
-
- control.AddTextBoxColumn("TestRoundedDouble", "Test header");
- control.AddTextBoxColumn("TestString", "Test string header");
- control.SetDataSource(new[]
- {
- new TestDataGridViewMultipleColumnsRow(new RoundedDouble(0, 2.5), "hello world")
- });
-
- var counter = 0;
- control.CurrentRowChanged += (sender, args) => counter++;
- control.SetCurrentCell(control.GetCell(0, 1));
-
- // When
- control.ResetLastSelectedRow();
- control.SetCurrentCell(control.GetCell(0, 0));
-
- // Then
- Assert.AreEqual(2, counter);
- }
- }
-
private enum TestEnum
{
NoDisplayName,
Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/IllustrationPointsControl.cs
===================================================================
diff -u -redb617ef7d51ddd52ed0b0095e679106925a837c -reffbd5371b578307e0995b16a979ce6eced8d9a4
--- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/IllustrationPointsControl.cs (.../IllustrationPointsControl.cs) (revision edb617ef7d51ddd52ed0b0095e679106925a837c)
+++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/IllustrationPointsControl.cs (.../IllustrationPointsControl.cs) (revision effbd5371b578307e0995b16a979ce6eced8d9a4)
@@ -64,7 +64,6 @@
data = value;
illustrationPointsChartControl.Data = data;
illustrationPointsTableControl.Data = data;
- illustrationPointsTableControl.ResetLastSelectedRow();
}
}
Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/IllustrationPointsTableControl.cs
===================================================================
diff -u -r5df0c04aac24764e1ebbf06e09591c8273aa2edf -reffbd5371b578307e0995b16a979ce6eced8d9a4
--- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/IllustrationPointsTableControl.cs (.../IllustrationPointsTableControl.cs) (revision 5df0c04aac24764e1ebbf06e09591c8273aa2edf)
+++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/IllustrationPointsTableControl.cs (.../IllustrationPointsTableControl.cs) (revision effbd5371b578307e0995b16a979ce6eced8d9a4)
@@ -81,11 +81,6 @@
}
}
- public void ResetLastSelectedRow()
- {
- illustrationPointsDataGridViewControl.ResetLastSelectedRow();
- }
-
private void InitializeEventHandlers()
{
illustrationPointsDataGridViewControl.CurrentRowChanged += DataGridViewOnCurrentRowChangedHandler;
Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/IllustrationPointsTableControlTest.cs
===================================================================
diff -u -rae9824e6a84307a59b36ca26a2fc948018c29d31 -reffbd5371b578307e0995b16a979ce6eced8d9a4
--- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/IllustrationPointsTableControlTest.cs (.../IllustrationPointsTableControlTest.cs) (revision ae9824e6a84307a59b36ca26a2fc948018c29d31)
+++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/IllustrationPointsTableControlTest.cs (.../IllustrationPointsTableControlTest.cs) (revision effbd5371b578307e0995b16a979ce6eced8d9a4)
@@ -259,27 +259,6 @@
Assert.AreSame(dataBoundItem.IllustrationPointControlItem, selection);
}
- [Test]
- public void ResetLastSelectedRow_WhenSelectingSameRow_FiresRowChangedEvent()
- {
- // Setup
- IllustrationPointsTableControl control = ShowControl();
- control.Data = GetControlItems();
-
- DataGridView dataGridView = ControlTestHelper.GetDataGridView(testForm, "DataGridView");
- DataGridViewControl dataGridViewControl = ControlTestHelper.GetDataGridViewControl(testForm, "illustrationPointsDataGridViewControl");
- dataGridViewControl.SetCurrentCell(dataGridView.Rows[0].Cells[0]);
- var eventThrown = false;
- dataGridViewControl.CurrentRowChanged += (sender, args) => eventThrown = true;
-
- // Call
- control.ResetLastSelectedRow();
- dataGridViewControl.SetCurrentCell(dataGridView.Rows[0].Cells[1]);
-
- // Assert
- Assert.IsTrue(eventThrown);
- }
-
private IllustrationPointsTableControl ShowControl()
{
var control = new IllustrationPointsTableControl();