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-15 20:35:54 +0300
committerJim Westfall <jwestfall@surrealistic.net>2014-11-15 20:35:54 +0300
commit24742dc038d520294578cf29a756b943ade221b9 (patch)
treedab17bc289579b0c92d05c6ce46f07826438a1c7 /mcs/class/Managed.Windows.Forms
parentad651ff43bb1d9284843fadd2f27136325a7188a (diff)
[MWF] Fix off-by-one from 5a5c683
first_row_index needs to be <= RowsLeft - 1, since we are comparing a row count vs an index.
Diffstat (limited to 'mcs/class/Managed.Windows.Forms')
-rw-r--r--mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs
index fc213814767..3ce4ab7b574 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs
@@ -5137,8 +5137,11 @@ namespace System.Windows.Forms {
if (RowsLeft < 0)
RowsLeft = 0;
- if (first_row_index > RowsLeft)
- first_row_index = RowsLeft;
+ if (first_row_index > RowsLeft - 1)
+ first_row_index = RowsLeft - 1;
+
+ if (first_row_index < 0)
+ first_row_index = 0;
if (RowsLeft == 0) {
MoveCurrentCell (-1, -1, true, false, false, true);