From 7180227d08b0ba6e0ccad1c52a393a625d738051 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Sat, 9 Dec 2006 01:46:56 +0000 Subject: [PATCH] * DataGrid.cs (set_CurrentCell): because EnsureCellVisibility calls EndEdit, it needs to be called before we set current_cell to its new value. Otherwise, we end up committing the value in the textbox to the new cell as well. Fixes bug #80160. 2006-12-08 Chris Toshok svn path=/trunk/mcs/; revision=69257 --- mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 7 +++++++ mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 5553c400cec..f7855f73dea 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,5 +1,12 @@ 2006-12-08 Chris Toshok + * DataGrid.cs (set_CurrentCell): because EnsureCellVisibility + calls EndEdit, it needs to be called before we set current_cell to + its new value. Otherwise, we end up committing the value in the + textbox to the new cell as well. Fixes bug #80160. + +2006-12-08 Chris Toshok + * Form.cs (set_CancelButton): if the button's DialogResult is None, set it to Cancel. Fixes bug 80180. diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs index 6214ba413df..40f918c76d0 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs @@ -517,9 +517,9 @@ namespace System.Windows.Forms int old_row = current_cell.RowNumber; - current_cell = value; + EnsureCellVisibility (value); - EnsureCellVisibility (current_cell); + current_cell = value; InvalidateRowHeader (old_row); InvalidateRowHeader (current_cell.RowNumber); -- 2.11.4.GIT