Unplanned
Last Updated: 27 Feb 2024 13:19 by ADMIN
Martin
Created on: 20 Mar 2023 15:35
Category: TreeView
Type: Bug Report
0
RadTreeView: ExpandTimerInterval property is not reset when dragging over several nodes

Repro-steps:

  1. Create a RadTreeView
  2. Set the TreeViewElement.ExpandTimerInterval to 5 seconds.
  3. Enable drag/drop.
  4. Fill the tree with random nodes and childnodes
  5. Drag a node over other nodes. Make sure you do not hover longer than 5 seconds over a single node. So just move around.

Observed behavior:

  1. After 5 seconds the node you are just hovering over, is expanding.

Expected behavior:

  1. No node will automatically expand. Every time a new node is hovered over, the timer will reset.


4 comments
ADMIN
Dinko | Tech Support Engineer
Posted on: 22 Feb 2024 13:11

Hi Martin,

Thank you for the additional details. You have a point here. Therefore I have changed the item status to unplanned. When our development team starts working on this item, we will change its status so that you can be notified of its progress.

Thank you again for your time to report this. Your Telerik Points are updated.

Regards,
Dinko | Tech Support Engineer
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.

Martin
Posted on: 21 Feb 2024 13:58

My apologies, I think I must have missed this post and that it needed an update.

Maybe I was not clear in the observed and expected behaviour.

When I open Windows Explorer (with the folder pane visible at the left) and I want to move a file from one folder to another (a subfolder of a folder called T). Keep in mind, I am a rather slow person:

  1. I Click on the file and start dragging
  2. I move the file over the tree with all the folders. The first folder I move over is called A.
  3. I move rather slowly down to folder B and folder C, etc.
  4. When I move down slowly, i hover over each folder for about 250ms.
  5. When I reach folder T i stop moving.
  6. I wait for one second, and the folder I am hovering over, expands. The subfolder is visible.
  7. I move to the subfolder and drop my file.

Now lets assume Windows Explorer was created using RadTreeView. This would happen:

  1. I Click on the file and start dragging
  2. I move the file over the tree with all the folders. The first folder I move over is called A.
  3. I move rather slowly down to folder B and folder C, etc.
  4. When I move down slowly, i hover over each folder for about 250ms.
  5. When I read folder E, the folder suddenly expands. I did not hover for 1 seconds, only 250ms. A whole list of subfolders, which I do not need, are "in my way". I start moving down.
  6. After about 4 subfolder, that subfolder expands again. 

The bug is, the auto expand timer starts counting down from 1 second when I hover over de first folder. The timer is NOT reset when I move down to the next folder. So when I reach the 4th folder (after 4 x 250ms) the timer reaches zero and expands the folder that the user is currently hovering over. 

I this desired behavior?


ADMIN
Dinko | Tech Support Engineer
Posted on: 16 Feb 2024 22:27

Hi Martin,

The feedback item status is changed to Declined due to inactivity.

Regards,
Dinko | Tech Support Engineer
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.

ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 27 Mar 2023 12:48

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.