Repro-steps:
Observed behavior:
Expected behavior:
Hi, Martin,
By default, the ExpandTimerInterval property specifies the interval of time in milliseconds which will pass before a hovered node is being expanded during drag and drop operation. However, please have in mind that while dragging a node if the target node has children or DropPosition is AsChildNode, the same expand timer will be started. Hence, after the interval of 5s (for example) the node will be expanded even if the mouse position is over another node.
This is the default implementation for better explanation:
protected override void OnPreviewDragOver(RadDragOverEventArgs e)
{
TreeNodeElement targetNodeElement = e.HitTarget as TreeNodeElement;
RadTreeViewElement treeView = e.HitTarget as RadTreeViewElement;
if (treeView != null)
{
e.CanDrop = treeView.ElementTree.Control.AllowDrop && treeView.Nodes.Count == 0 && this.IsInValidState(treeView);
}
else if (targetNodeElement != null)
{
DropPosition dropPosition = this.GetDropPosition(this.DropLocation, targetNodeElement);
e.CanDrop = this.CanDragOver(dropPosition, targetNodeElement);
RadTreeViewDragCancelEventArgs args = new RadTreeViewDragCancelEventArgs(draggedNode, targetNodeElement.Data);
args.Cancel = !e.CanDrop;
args.DropPosition = dropPosition;
this.owner.OnDragOverNode(args);
e.CanDrop = !args.Cancel;
}
base.OnPreviewDragOver(e);
}
In the CanDragOver method, the following logic is executed:
if (dropPosition == DropPosition.AsChildNode && !targetNode.Expanded && targetNode.HasNodes)
{
targetTreeView.AutoExpand(targetNode);
this.HideHintWindow();
this.ShowHintWindow();
}
protected virtual internal void AutoExpand(RadTreeNode node)
{
if (!node.Expanded)
{
this.expandTimer.Tag = node;
this.expandTimer.Start();
}
}
Could you please specify how this situation should be handled according to your expectations if you want to restart the timer every time after a new node is hovered?
Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.