From 3cff5a230be100ac84f74ef1d65f4a33f000d353 Mon Sep 17 00:00:00 2001 From: Ivan Zlatev Date: Mon, 8 Dec 2008 05:25:43 +0000 Subject: [PATCH] 2008-12-08 Ivan N. Zlatev * DataGridViewCheckBoxCell.cs: Fix to make it work. Wrong value was casted to CheckState. svn path=/trunk/mcs/; revision=120974 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 5 +++++ .../System.Windows.Forms/DataGridViewCheckBoxCell.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 0deff949da5..d1a1c4008e6 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2008-12-08 Ivan N. Zlatev + + * DataGridViewCheckBoxCell.cs: Fix to make it work. Wrong value was + casted to CheckState causing InvalidCastExceptions. + 2008-12-08 Ivan N. Zlatev * DataGridView.cs: Fix the DataGridViewEditMode.EditOnEnter behavior diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCheckBoxCell.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCheckBoxCell.cs index 7b64b73b4a7..8a15579e181 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCheckBoxCell.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCheckBoxCell.cs @@ -386,7 +386,7 @@ namespace System.Windows.Forms { if ((CheckState)value == CheckState.Unchecked) state = (CheckBoxState)check_state; - else if ((CheckState)editingCellFormattedValue == CheckState.Checked) + else if ((CheckState)value == CheckState.Checked) state = (CheckBoxState)((int)check_state + 4); else if (threeState) state = (CheckBoxState)((int)check_state + 8); -- 2.25.1