diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2005-02-02 05:06:04 +0300 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2005-02-02 05:06:04 +0300 |
commit | 24a11f2eb045546fcbf8b51d410657d411817001 (patch) | |
tree | 803963dde2dd0018a79433a15afb6500f4d985ad /mcs | |
parent | c04c8b4c0eda023fed46d635aef73119efd1d53d (diff) |
2005-02-02 Atsushi Enomoto <atsushi@ximian.com>
* DataView.cs : CancelEditRowView() and DeleteRowView() was incorrectly
checking target tables. They also should raise events if required.
svn path=/trunk/mcs/; revision=39959
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/System.Data/System.Data/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System.Data/System.Data/DataView.cs | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/mcs/class/System.Data/System.Data/ChangeLog b/mcs/class/System.Data/System.Data/ChangeLog index 2eb7245d86a..b0a44c7c781 100644 --- a/mcs/class/System.Data/System.Data/ChangeLog +++ b/mcs/class/System.Data/System.Data/ChangeLog @@ -1,5 +1,10 @@ 2005-02-02 Atsushi Enomoto <atsushi@ximian.com> + * DataView.cs : CancelEditRowView() and DeleteRowView() was incorrectly + checking target tables. They also should raise events if required. + +2005-02-02 Atsushi Enomoto <atsushi@ximian.com> + * DataView.cs : simplify code with UnsortedList. 2005-02-01 Atsushi Enomoto <atsushi@ximian.com> diff --git a/mcs/class/System.Data/System.Data/DataView.cs b/mcs/class/System.Data/System.Data/DataView.cs index cd0c5b31c71..21945165718 100644 --- a/mcs/class/System.Data/System.Data/DataView.cs +++ b/mcs/class/System.Data/System.Data/DataView.cs @@ -356,19 +356,25 @@ namespace System.Data internal void CancelEditRowView (DataRowView rowView) { - if (addNewCache.Contains (rowView)) + int index = IndexOfRowView (rowView); + if (addNewCache.Contains (rowView.Row)) addNewCache.Remove (rowView.Row); else rowViewPool.Remove (rowView.Row); + if (index >= 0) + OnListChanged (new ListChangedEventArgs (ListChangedType.ItemDeleted, index, -1)); rowView.Row.CancelEdit (); } internal void DeleteRowView (DataRowView rowView) { - if (addNewCache.Contains (rowView)) + int index = IndexOfRowView (rowView); + if (addNewCache.Contains (rowView.Row)) addNewCache.Remove (rowView.Row); else rowViewPool.Remove (rowView.Row); + if (index >= 0) + OnListChanged (new ListChangedEventArgs (ListChangedType.ItemDeleted, index, -1)); rowView.Row.Delete (); } |