Author: calberto
Date: 2007-10-06 03:35:22 -0400 (Sat, 06 Oct 2007)
New Revision: 87027
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
Log:
* ListView.cs: When the last item is focused and is removed,
move the focus to the previous item (in Items order). This is what MS
does.
Fixes #330415.
2007-10-06 Carlos Alberto Cortez <[EMAIL PROTECTED]>
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-10-06 06:59:09 UTC (rev 87026)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-10-06 07:35:22 UTC (rev 87027)
@@ -1,5 +1,12 @@
2007-10-06 Carlos Alberto Cortez <[EMAIL PROTECTED]>
+ * ListView.cs: When the last item is focused and is removed,
+ move the focus to the previous item (in Items order). This is what MS
+ does.
+ Fixes #330415.
+
+2007-10-06 Carlos Alberto Cortez <[EMAIL PROTECTED]>
+
* ListView.cs: In ListViewItemCollection, make Remove call RemoveAt,
instead of the opposite (RemoveAt call Remove). This is a better
approach since we don't need to to a pair of traversals when using
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
2007-10-06 06:59:09 UTC (rev 87026)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
2007-10-06 07:35:22 UTC (rev 87027)
@@ -4843,6 +4843,10 @@
bool selection_changed = false;
if (is_main_collection && owner != null) {
+
+ if (item.Focused && index + 1 == Count)
// Last item
+ owner.SetFocusedItem (index ==
0 ? -1 : index - 1);
+
selection_changed =
owner.SelectedIndices.Contains (index);
owner.item_control.CancelEdit (item);
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches