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

2011 Q2 Treeview - Drag Drop not working?

9 Answers 187 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
rjmorton
Top achievements
Rank 1
rjmorton asked on 19 Jul 2011, 11:30 PM
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.

9 Answers, 1 is accepted

Sort by
0
Svett
Telerik team
answered on 21 Jul 2011, 01:41 PM
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!

0
rjmorton
Top achievements
Rank 1
answered on 21 Jul 2011, 03:56 PM
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.
0
Svett
Telerik team
answered on 26 Jul 2011, 03:08 PM
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!

0
rjmorton
Top achievements
Rank 1
answered on 26 Jul 2011, 04:28 PM
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...
0
Svett
Telerik team
answered on 29 Jul 2011, 08:57 AM
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!

0
Bradley Lane
Top achievements
Rank 1
answered on 03 Aug 2011, 10:01 AM
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
0
Svett
Telerik team
answered on 05 Aug 2011, 06:53 AM
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 >>
0
Tom
Top achievements
Rank 1
answered on 13 Oct 2011, 07:17 AM
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.
0
Svett
Telerik team
answered on 17 Oct 2011, 12:28 PM
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.

Tags
Treeview
Asked by
rjmorton
Top achievements
Rank 1
Answers by
Svett
Telerik team
rjmorton
Top achievements
Rank 1
Bradley Lane
Top achievements
Rank 1
Tom
Top achievements
Rank 1
Share this question
or