Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

OnDragExit and RemoveItems causing OI crash

I have a window with two adjacent tree controls for the purpose of allowing a user to select a subset of options by dragging from one tree to the other.

No problems there. The intent was to allow them to remove options from the subset by simply dragging them outside of the control. So on the OnDragExit of one of the trees I call the removeitems method. This works in most instances. However, if the drag happens to drag over the top of the other tree control then OI crashes.

1. Drag from left tree to right. OnDragEnter of right control performs a transferitems from left to right.
2. Drag from right control, OnDragExit performs a removeitems from itself. If items were dragged further to the right then all works ok but if they were dragged to the left of the control and subsequently over the top of the leftmost control, then the call to removeitems causes an OI crash.

Windows XP.
OI 9.2.1
And we use the individual controls, not the PRO

Comments

  • Unfortunately this one has reared its ugly head again but this time I have some more info to assist in the debugging.

    The scenario is as above. The issue is that on the OnDragExit event, the RemoveItems method tends to hang the system. This only occurs when the drag carries over the other tree control



    User drags items from the tree control on the left to the tree control on the right to produce that list.
    No problem.
    User drags items from the tree control on the right to anywhere outside the bounds of the control and we use the removeitems method to remove them. This too works ok unless the mouse extends back over the tree control on the left.
    The buttons you can see in the middle were the work around and they work perfectly every time but I would prefer to stick with just drag and drop or drag and remove.

    There is one more tidbit that I've just discovered this afternoon, the hang only seems to occur when there is a large number of items in the control that you are removing from.
    What's a large number? I haven't determined that figure yet.
    What I do know is if there are say only half a dozen items on the right, I can drag any number of them over the left hand side and no problem. If on the other hand there are 100 items on the right, then dragging even just one over to the left will cause the hang.

    My uneducated guess is that when the list to remove from reaches a certain size, the removeitems method is getting lost within some other event processing for the LH tree but I don't know what that would be. All our events are qualified asynchronously. This is occurring with the latest version of the pro control released the other day.
  • One more piece of info.
    That screenshot above had 54 items on the right.
    When I did the drag to the left, no hang so perhaps the magic number is between 54 and 100 or more likely it's probably not number of items but some other 'size' factor that I didn't reach with these 54 items.
  • 71 items - good
    77 items - :-(
Sign In or Register to comment.