FOR lnCounter = 1 TO oSource.ListCount IF oSource.Selected(lnCounter) AND !oSource.Isdimmed(lnCounter) oSource.DupeRow(@laSource, lnCounter) This.AddItemToRowSourceArray(@laSource, .T.) IF This.RowSourceType = 0 This.AddListItem(laSource[1,1], laSource[1, 2]) ENDIF oSource.MarkRow(lnCounter) ENDIF ENDFORThis is the code with my modifications:
*-- LW 3/29/2004 - added lnIndex to correctly remove * items whose position had been changed * by MoverBar in the selected array LOCAL lcArray, lnIndex lcArray = oSource.RowSource FOR lnCounter = 1 TO oSource.ListCount IF oSource.Selected(lnCounter) AND !oSource.Isdimmed(lnCounter) *Search the RowSouce for the selected item. Which row was it in when it was originally *added? If it has been moved in the selected list, the row in the list will not be the same and *the wrong row will be duplicated by the DupeRow method below lnIndex = ASCAN(&lcArray, oSource.List(lnCounter),1,-1,1,8) * change subsequent references to lnCounter -> lnIndex *oSource.DupeRow(@laSource, lnCounter) && this is the original Framework code oSource.DupeRow(@laSource, lnIndex) THIS.AddItemToRowSourceArray(@laSource, .T.) IF THIS.RowSourceType = 0 THIS.AddListItem(laSource[1,1], laSource[1, 2]) ENDIF * change subsequent references to lnCounter -> lnIndex *oSource.MarkRow(lnCounter) && this is the original Framework code oSource.MarkRow(lnIndex) ENDIF ENDFORHas anyone else run into this problem in their apps? Have you found a more generic fix? Will my fix work in your implementation? I'd appreciate a second (or third or fourth or tenth) pair of eyes to detect any gotchas that I'm missing.