I've got this half working, using the DragDropQueryEvent. If the destination's parent is a Set, I change the destination to the set and the drop position to Inside.
This works for the first time hovering over the reports inside a set, but the next time I hover over the same objects the text becomes "Drop After Set x". As far as I can tell, the same code is being run. The drop is occurring in the right place, but the text isn't correct.
Any insight into what's happening, or another way to get this behaviour is greatly appreciated!
Below is some simplified code of my DragDropQueryEvent
private void DragQuery_CanDrop(object sender, DragDropQueryEventArgs e)
{
var treeViewItem = e.Options.Destination as RadTreeViewItem;
if (treeViewItem != null)
{
if (treeViewItem.Item is Set )
{
if (treeViewItem.DropPosition == DropPosition.Inside) //can only drop INSIDE set
{
....
e.QueryResult = true;
}
else
{
e.QueryResult = false;
}
}
else if (treeViewItem.Item is Report)
{
if (treeViewItem.ParentItem != null && treeViewItem.ParentItem.Item is Set)
{
e.Options.Destination = treeViewItem.ParentItem;
treeViewItem.DropPosition = DropPosition.Inside;
...
e.QueryResult = true;
}
else
{
e.QueryResult = false;
}
}
else
{
e.QueryResult = false;
}
}
}