This is a migrated thread and some comments may be shown as answers.

Drag and drop problem

11 Answers 301 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Shuo
Top achievements
Rank 1
Shuo asked on 26 Aug 2008, 08:15 AM
The RadTreeView control supports to drag and drop a tree node in the tree view, and the node will be added either as a child or as a sibling of other nodes.

My problem is that can I only allow the users to add the draged node as a sibling and disable the functionality that the users can add the node as a child? (perhaps should do something to the arrow point and the dashed line...?)

11 Answers, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 27 Aug 2008, 02:16 PM
Hello Shuo,

You could try handling the DragEnding event of RadTreeView and cancel the drag and drop operation if a node is going to be dropped as a child of another:
void radTreeView1_DragEnding(object sender, RadTreeViewDragCancelEventArgs e) 
        { 
            if (e.Direction == Telerik.WinControls.ArrowDirection.Right) 
            { 
                e.Cancel = true
            } 
        } 

Don't hesitate to contact us if you have other questions.

Regards,
Jordan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Don't hesitate to contact us if you have other questions.

0
Shuo
Top achievements
Rank 1
answered on 27 Aug 2008, 04:21 PM
Thanks for your answer and that does work but can't we hide the arrow point for adding as a chind? Now users can yet see three choices(up,down,as a child) although they can't use the arrow point "as a child".
0
Jordan
Telerik team
answered on 28 Aug 2008, 07:47 AM
Hi Shuo,

Unfortunately, with the current implementation that behavior cannot be modified. We will consider changing this if demand for this feature rises.
 

Best wishes,
Jordan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mark Griebling
Top achievements
Rank 1
answered on 25 Sep 2008, 06:12 PM
I would like to hide the arrow and the line as we only want to allow the nodes to be added as children.
0
Jordan
Telerik team
answered on 26 Sep 2008, 07:58 AM
Hello Mark Griebling,

You can hide the arrow by setting the ShowFeedbackForm property of RadTreeView to false:

this.radTreeView1.ShowFeedbackForm = false;


Kind regards,
Jordan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Raj Sharma
Top achievements
Rank 1
answered on 15 Feb 2010, 04:51 PM

I am also looking for the above features...

My problem is that can I only allow the users to add the draged node as a sibling and disable the functionality that the users can add the node as a child? (perhaps should do something to the arrow point and the dashed line...?)
0
Victor
Telerik team
answered on 16 Feb 2010, 09:28 AM
Hi Raj Sharma,

We have not yet rafactored RadTreeView Drag & Drop logic. Since you are the third person to ask for extensions recently, we are considering the features requested so far. The new drag & drop functionality will most likely be available for Q2 2010. Write again if you have other questions.

Best wishes,
Victor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Thomas Ossowski
Top achievements
Rank 1
answered on 11 Mar 2010, 03:54 PM
Hello everybody,

do I have the same problem?

Let me describe the scenario:

There is a RadListBox and a RadTreeView. You can drag ListBoxItems to the treeview and drop them on some specific RadTreeNodes. Whether you can drop an item or not is handled in RadTreeView´s DragOver event - so the DragDropEffect is set to Move or None.

Everything´s fine so far.

In our application you also should be able to Drag Drop RadTreeNodes inside the treeview with almost the same handling, but the DragOver event is not raised. Is there another event / way to get this working??

Greetings,
Thomas

0
Victor
Telerik team
answered on 16 Mar 2010, 02:43 PM
Hello Thomas Ossowski,

Thank you for writing.

There must be something in your code that prevents the DragOver event from firing. DragOver is an event declared on the Control class level, RadTreeView has no code which can prevent it from firing. If you are using RadTreeView's drag and drop, however, you must use only them, they do not work with the standard OLE drag & drop mechanism. 

If you still believe that RadTreeView is misbehaving in some way, I would kindly ask you to post a code snipped which demonstrates what you are doing so that I may assist you further. The other available option for you is to open a new support ticket and send me a sample project.

Sincerely yours,
Victor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Paul Thorsteinson
Top achievements
Rank 1
answered on 12 May 2010, 09:22 PM
I agree in the 2010 Q1 release it is very misleading.  You can set e.cancel in the DragEnding event but the user ends up confused because the arrow indicator shows that this is an option.  Normal windows drag and drop allows you to set the effect so that the user gets visual feedback that the drop is not allowed.  I guess the workaround is to roll your own code around the standard windows events.

EDIT:  Just tried to do the drag and drop the way you would with std window events but it does'nt really work because the ItemDrag only fires when you set the allowdragdrop property which then seems to kick in the pre-wired drag and drop functionality (which I don't want because it makes it look like you can drag items to be siblings where they should not be!)
0
Victor
Telerik team
answered on 18 May 2010, 10:03 AM
Hi Paul Thorsteinson,

Thank you for the feedback.

We are aware that the mixture of RadTreeView's drag and drop properties and events and the Windows OLE mechanism is a source of confusion. The two approaches simply do not work together and as a rule of thumb you should always use either one or the other, never both mechanisms. We will consider extending RadTreeView's drag and drop to support more visual cues that reflect the state of the drag and drop operation.

Write again if you have questions or if you need assistance with our controls.

All the best,
Victor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Treeview
Asked by
Shuo
Top achievements
Rank 1
Answers by
Jordan
Telerik team
Shuo
Top achievements
Rank 1
Mark Griebling
Top achievements
Rank 1
Raj Sharma
Top achievements
Rank 1
Victor
Telerik team
Thomas Ossowski
Top achievements
Rank 1
Paul Thorsteinson
Top achievements
Rank 1
Share this question
or