move the focus to the previous item (in Items order). This is what MS
does.
Fixes #330415.
2007-10-06 Carlos Alberto Cortez <calberto.cortez@gmail.com>
svn path=/trunk/mcs/; revision=87027
+2007-10-06 Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+ * 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 <calberto.cortez@gmail.com>
* ListView.cs: In ListViewItemCollection, make Remove call RemoveAt,
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);
}