Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Westfall <jwestfall@surrealistic.net>2014-11-13 06:50:32 +0300
committerJim Westfall <jwestfall@surrealistic.net>2014-11-13 06:50:32 +0300
commitad651ff43bb1d9284843fadd2f27136325a7188a (patch)
treedcb9dd4c40a44234151fea5a88a86c016431c5ea /mcs/class/Managed.Windows.Forms
parent5a5c6836967d924d1f88be6b42d0c93d504130c8 (diff)
[MWF] Add unit test for #24372
Diffstat (limited to 'mcs/class/Managed.Windows.Forms')
-rw-r--r--mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs
index 666bd7a6fec..e973b2b9232 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs
@@ -2569,6 +2569,42 @@ namespace MonoTests.System.Windows.Forms
Assert.AreEqual (30, dgv.Rows [0].MinimumHeight);
}
}
+
+ [Test] // Xamarin bug #24372
+ public void Bug24372_first_row_index ()
+ {
+ Form form = new Form ();
+ DataGridView24372 dgv = new DataGridView24372 ();
+ dgv.Parent = form;
+ dgv.ColumnCount = 1;
+ dgv.RowCount = 100;
+ dgv.CurrentCell = dgv[0,50];
+ dgv.Focus ();
+ form.Show ();
+
+ dgv.Rows.Clear ();
+ form.Refresh ();
+ Application.DoEvents ();
+
+ if (dgv.HasException)
+ Assert.Fail("#A1");
+
+ form.Dispose ();
+ }
+
+ class DataGridView24372 : DataGridView
+ {
+ public bool HasException { get; private set; }
+ protected override void OnPaint (PaintEventArgs e)
+ {
+ HasException = false;
+ try {
+ base.OnPaint(e);
+ } catch (ArgumentOutOfRangeException ex) {
+ HasException = true;
+ }
+ }
+ }
}
[TestFixture]