2011 Q2 Treeview - Drag Drop not working?

10 posts, 0 answers
  1. rjmorton
    rjmorton avatar
    17 posts
    Member since:
    Aug 2006

    Posted 19 Jul 2011 Link to this post

    Is there something broken about dragdrop in Q2 treeview?
    I have a treeview where I have enabled 'AllowDragDrop' and 'AllowDrop'. However, the 'ItemDrag', 'DragStarted' and 'DragStarting' events aren't firing all all.

    Is there something I'm doing wrong? The documentation makes it look easy!
    I'm basically wanting to detect when a node from the first treeview is dragged into the second treeview.

    Thanks,
    Richard.
  2. Svett
    Admin
    Svett avatar
    728 posts

    Posted 21 Jul 2011 Link to this post

    Hi Rjmorton,

    I did not manage to reproduce the issue with the supplied information. Could you share with us the code snippets that demonstrate how you initialize the RadTreeView control? Notice that drag and drop operation does not work in bound mode.

    Greetings,
    Svett
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. UI for WinForms is Visual Studio 2017 Ready
  4. rjmorton
    rjmorton avatar
    17 posts
    Member since:
    Aug 2006

    Posted 21 Jul 2011 Link to this post

    Ah - well, that's the problem then - I'm using data binding.Is the next (or a future) release going to support data bound drag and drop? It's a fairly fundamental thing for a tree view control to support! I know you completely replaced the old control and I'm guessing that you just haven't had time to put it in yet, but if you can give an idea on roadmap for this it would be helpful. Otherwise I'm going to have to use a different control.

    There's no way I can modify my app to use unbound data, it's way too much rearchitecture to get around a missing feature in a control.

    ps - you should flag this page in the help file to inform that currently drag drop isn't supported in bound mode. I'm sure that will save developers many hours of frustrated digging!
    ms-help://TelerikWinForms.2011.2.0/TelerikWinForms.2011.2.0/html/681684F3-010F-4A92-856A-7E792BBB40E2.htm

    Thanks,
    Richard.
  5. Svett
    Admin
    Svett avatar
    728 posts

    Posted 26 Jul 2011 Link to this post

    Hi Rjmorton,

    Presently, RadGridView does not support drag and drop in bound mode. We will consider implementing this feature in one of the next releases. In the meantime, the only way to allow drag and drop is by using the RadGridView in unbound mode. 

    Thank you for your feedback.

    We will improve the documentation mentioning that the drag and drop operation is available only in the unbound mode.

    Greetings,
    Svett
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  6. rjmorton
    rjmorton avatar
    17 posts
    Member since:
    Aug 2006

    Posted 26 Jul 2011 Link to this post

    Thanks for the update Svett.
    You mentioned RadGridView in your post which I'm assuming is a typo, but just to be 100% clear, are you saying that RadTREEView does not support drag/drop in bound mode? If not, then yes - getting support for that would be fantastic (I can't believe other people haven't been asking for it already - drag and drop is a fairly fundamental use inside a treeview controls).

    I wouldn't even need anything complicated, just a notification that Node X has been drag/dropped onto Y. Then I could handle all the plumbing code myself. Right now using unbound Treeviews is not going to happen in my application - way too much refactoring to do so...
  7. Svett
    Admin
    Svett avatar
    728 posts

    Posted 29 Jul 2011 Link to this post

    Hi Rjmorton,

    I confirm that at this time, RadTreeView does not support drag and drop in bound mode. This is something that we should make available for our customers in one of the next major releases. In the meantime, you can use this feature only in unbound mode.

    Nevertheless, you can replace the default drag and drop behavior by creating a custom TreeViewDragDropService:

    public class RTreeView : RadTreeView
    {
        public override string ThemeClassName
        {
            get
            {
                return typeof(RadTreeView).FullName;
            }
            set
            {
                base.ThemeClassName = value;
            }
        }
     
        protected override RadTreeViewElement CreateTreeViewElement()
        {
            return new RTreeViewElement();
        }
    }
     
    public class RTreeViewElement : RadTreeViewElement
    {
        protected override Type ThemeEffectiveType
            {
                get
                {
                    return typeof(RadTreeViewElement);
                }
            }
     
        protected override TreeViewDragDropService CreateDragDropService()
        {
            return new RTreeViewDragDropService(this);
        }
    }
     
    public class RTreeViewDragDropService : TreeViewDragDropService
    {
        public RTreeViewDragDropService(RadTreeViewElement treeView)
            : base(treeView)
        {
     
        }
        protected override bool CanStart(object context)
        {
            return context is TreeNodeElement;
        }
     
        protected override void OnPreviewDragDrop(Telerik.WinControls.RadDropEventArgs e)
        {
            // TO DO: Your drag and drop logic here
        }
    }

    Notice that you should override the OnPreviewDraDrop method where you can place your drag and drop logic. Best wishes,
    Svett
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  8. Bradley Lane
    Bradley Lane avatar
    22 posts
    Member since:
    Aug 2012

    Posted 03 Aug 2011 Link to this post

    Hi,

    I'm running into the same problem. I have a databound treeview (self referencing) and need to add drag and drop functionality.

    Is there an ETA on enabling this feature or somewhere we can Vote for it?

    Thanks,
    Brad
  9. Svett
    Admin
    Svett avatar
    728 posts

    Posted 05 Aug 2011 Link to this post

    Hello Bradley,

    This feature is not addressed yet. Nevertheless, you can vote for this feature via our public issue tracking system here.

    Best wishes,
    Svett
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
  10. Tom
    Tom avatar
    1 posts
    Member since:
    Oct 2011

    Posted 13 Oct 2011 Link to this post

    Hi,
    This code you posted doesn't compile in my project. It seems that objects: RadTreeViewElement, TreeNodeElement, TreeViewDragDropService don't exist in Web dlls that I downloaded recently, version 2011.2.915.40. so how should i get them to work in a web application 

    help me out with this, i'm trying to override the drag and drop functionality for bound tree.
  11. Svett
    Admin
    Svett avatar
    728 posts

    Posted 17 Oct 2011 Link to this post

    Hi Tom,

    There is no such version (2011.2 915.40) of RadControls for Winforms. Are you using RadControls for ASP.NET AJAX? If so, please post your questions in the appropriate forum section as this section concerns RadTreeView for WinForms only.

    Thank you for your understanding.

    Regards,
    Svett
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

Back to Top
UI for WinForms is Visual Studio 2017 Ready