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

RadTreeView - Drop Inside RadTreeViewItem

3 Answers 68 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 2
Jason asked on 08 May 2013, 12:16 AM
Hello Telerik,
I am attempting to configure the visual for a RadTreeViewItem to only show the Drop Inside functionality. However, the article on the help pages is outdated, and references an obsoleted class.

With 2013 Q1, how do you configure the desired functionality to:
Hide 'Drop Before/After'
Hide Line between items in the tree view
Show 'Drop Inside'

Additional note:
I am using the PreviewDragEnded event to handle the dropped item with custom business logic. The dropped item will not go in an IList which the RadTreeViewItem object contains. This is simply to configure the UI visual which the user views, not to actually move data around using the control.

3 Answers, 1 is accepted

Sort by
0
Accepted
Pavel R. Pavlov
Telerik team
answered on 10 May 2013, 12:24 PM
Hi Jason,

Recently we changed the build-in drag-drop manager of the RadTreeView control. In the past it used the RadDragAndDropManager, which is now obsolete. Currently you are allowed to choose which manager to use (the obsolete one or the currently supported one). This can be done by setting the telerik:TreeViewSettings.DragDropExecutionMode attached property. If you set it to Legacy you will use the obsolete manager, otherwise (setting it to New) you will use the DragDropManager. In the future we will delete the obsolete manager and the control will use the new one.

Please note that in order to use the new manager you will have to subscribe to the desired events and customize the drag-drop logic according to your scenario. You can do this using this code just after the InitializeComponent() method:

DragDropManager.AddDragInitializeHandler(this.xTree, OnTreeDragInitialize);        
DragDropManager.AddDropHandler(
this.xTree, OnTreeDrop);
DragDropManager.AddDragOverHandler(this.xTree, OnTreeDragOver);
For more information about the DragDropManager you can refer to this article.

Furthermore, you can take a look at our online demonstration projects and see how we use custom behaviors.

I hope this will work for you.

Kind regards,
Pavel R. Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Thanh
Top achievements
Rank 1
answered on 01 Sep 2015, 09:46 AM

Hi,

 I am using dll Version 2011.1.516.1040, I can't do action "Drop Inside" or "Drop After" a node, it just let me "Drop Before", no matter how I tried.

I use Telerik example to test :

 <telerik:RadTreeView x:Name="radTreeView" IsDragDropEnabled="True">
                    <telerik:RadTreeViewItem Header="Sport Categories">
                        <telerik:RadTreeViewItem Header="Football">
                            <telerik:RadTreeViewItem Header="Futsal"/>
                            <telerik:RadTreeViewItem Header="Soccer"/>
                        </telerik:RadTreeViewItem>
                        <telerik:RadTreeViewItem Header="Tennis">
                            <telerik:RadTreeViewItem Header="Table Tennis"/>
                        </telerik:RadTreeViewItem>
                        <telerik:RadTreeViewItem Header="Cycling">
                            <telerik:RadTreeViewItem Header="Road Cycling"/>
                            <telerik:RadTreeViewItem Header="Indoor Cycling"/>
                            <telerik:RadTreeViewItem Header="Mountain Bike"/>
                        </telerik:RadTreeViewItem>
                    </telerik:RadTreeViewItem>

                    <telerik:RadTreeViewItem Header="Sport Categories 2">
                        <telerik:RadTreeViewItem Header="Cycling 2">
                            <telerik:RadTreeViewItem Header="Road Cycling 2"/>
                            <telerik:RadTreeViewItem Header="Indoor Cycling 2"/>
                            <telerik:RadTreeViewItem Header="Mountain Bike 2"/>
                        </telerik:RadTreeViewItem>
                    </telerik:RadTreeViewItem>
                    
                </telerik:RadTreeView>

=> But when I use the older version 2010.3.1213.1040, it let me "Drop Inside". 

Could you please explain that ? 

My runtime version need to use Version 2011.1.516.1040

 

Thanks

0
Martin Ivanov
Telerik team
answered on 03 Sep 2015, 07:49 AM
Hi Thanh,

I tested version 2011.1 516 of UI for Silverlight with the code snippet from your last reply but I wasn't able to reproduce the described behavior. The drop inside and drop after operations work as expected. If possible for you, I recommend you to upgrade to the latest version of the Telerik controls so you can take advantage of the newest features and bug fixes.

Regards,
Martin
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
TreeView
Asked by
Jason
Top achievements
Rank 2
Answers by
Pavel R. Pavlov
Telerik team
Thanh
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or