Hi!
I am trying to get drag & drop working for my TreeListView, and I noticed a possible bug in the adorner for the nodes in the tree.
For some dragged items, I want to disallow dropping 'On' targets, just 'Before' and 'After', so in the OnDragOver and OnDrop I check to see if the incoming 'dropArea' is set to 'TreeItemDropArea.On', and if it is, I return TreeITemDropArea.None. This works well logically (the items get dropped in the proper space in the OnDrop), but I noticed that the adorner for the targetItem still shows 'On' for all items except the last one in the list of children.
To reproduce this problem, in the TreeListBoxDragDrop example, in CustomTreeListBoxItemAdapter.cs on line 81 change:
if ((targetItem != null) && (dropArea != TreeItemDropArea.None) && (e.Data.GetDataPresent(TreeListBox.ItemDataFormat))) {
to:
if ((targetItem != null) && (dropArea != TreeItemDropArea.None) && (dropArea != TreeItemDropArea.On) && (e.Data.GetDataPresent(TreeListBox.ItemDataFormat))) {
Then, drag the 'Cherry' item onto the 'Raspberry' item. I'd expect that only the After or Before adorners would show up, but when moving the mouse around a bit, you can get the 'On' adorner to show, when the 'After' adorner should be showing instead.
When dragging the 'Cherry' item onto the last item in the berries list 'Strawberry', it does work correctly.
Cheers,
Nick