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
path: root/mcs
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2005-02-02 05:06:04 +0300
committerAtsushi Eno <atsushieno@gmail.com>2005-02-02 05:06:04 +0300
commit24a11f2eb045546fcbf8b51d410657d411817001 (patch)
tree803963dde2dd0018a79433a15afb6500f4d985ad /mcs
parentc04c8b4c0eda023fed46d635aef73119efd1d53d (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/ChangeLog5
-rw-r--r--mcs/class/System.Data/System.Data/DataView.cs10
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 ();
}