Drag and drop problem

12 posts, 0 answers
  1. Shuo
    Shuo avatar
    6 posts
    Member since:
    Jul 2008

    Posted 26 Aug 2008 Link to this post

    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...?)
  2. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 27 Aug 2008 Link to this post

    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.

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Shuo
    Shuo avatar
    6 posts
    Member since:
    Jul 2008

    Posted 27 Aug 2008 Link to this post

    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".
  5. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 28 Aug 2008 Link to this post

    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.
  6. Mark Griebling
    Mark  Griebling avatar
    129 posts
    Member since:
    Dec 2005

    Posted 25 Sep 2008 Link to this post

    I would like to hide the arrow and the line as we only want to allow the nodes to be added as children.
  7. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 26 Sep 2008 Link to this post

    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.
  8. Raj Sharma
    Raj Sharma avatar
    7 posts
    Member since:
    Jan 2010

    Posted 15 Feb 2010 Link to this post


    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...?)
  9. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 16 Feb 2010 Link to this post

    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.
  10. Thomas Ossowski
    Thomas Ossowski avatar
    5 posts
    Member since:
    Feb 2010

    Posted 11 Mar 2010 Link to this post

    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

  11. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 16 Mar 2010 Link to this post

    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.
  12. Paul Thorsteinson
    Paul  Thorsteinson avatar
    1 posts
    Member since:
    Mar 2010

    Posted 12 May 2010 Link to this post

    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!)
  13. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 18 May 2010 Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready