Skip to content

Commit 8d565dd

Browse files
author
grammarian
committed
- InsertObjects() when in a non-Detail View now correctly positions the items (SF bug #154)
git-svn-id: https://svn.code.sf.net/p/objectlistview/code/cs/trunk@835 0bec5ed8-b53f-49e6-9885-ce7bc93af311
1 parent 5ea2e34 commit 8d565dd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ObjectListView/ObjectListView.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Date: 9/10/2006 11:15 AM
66
*
77
* Change log
8+
* 2018-10-06 JPP - InsertObjects() when in a non-Detail View now correctly positions the items (SF bug #154)
89
* 2018-09-01 JPP - Hardened code against the rare case of the control having no columns (SF bug #174)
910
* The underlying ListView does not like having rows when there are no columns and throws exceptions.j
1011
* 2018-05-05 JPP - Added OLVColumn.EditorCreator to allow fine control over what control is used to edit
@@ -4661,7 +4662,10 @@ public virtual void InsertObjects(int index, ICollection modelObjects) {
46614662

46624663
// If we are filtering the list, there is no way to efficiently
46634664
// insert the objects, so just put them into our collection and rebuild.
4664-
if (this.IsFiltering) {
4665+
// Sigh -- yet another ListView anomoly. In every view except Details, an item
4666+
// inserted into the Items collection always appear at the end regardless of
4667+
// their actual insertion index.
4668+
if (this.IsFiltering || this.View != View.Details) {
46654669
index = Math.Max(0, Math.Min(index, ourObjects.Count));
46664670
ourObjects.InsertRange(index, modelObjects);
46674671
this.BuildList(true);

0 commit comments

Comments
 (0)