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

How to enable dropping item inside the treeviewitem

1 Answer 97 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Prabakaran
Top achievements
Rank 1
Prabakaran asked on 17 Nov 2015, 02:39 AM

Dear Team,

I want to drag and drop items to before/after/drop inside the treeviewitem. i can able to drag and drop before/after the item but not able to drop inside the treeview item. please refer the below xaml script and the attached screenshot for more info. please help to sort this problem. How i could able to drop the item inside another(Parent-child pattern).

<telerik:RadTreeView
                                         x:Name="xTreeView"
                                         ItemsSource="{Binding Categories,Mode=TwoWay}"                                                    
                                                     mouse:MouseDoubleClick.Command="{Binding ShowItemCommand}"
                                         mouse:MouseDoubleClick.CommandParameter="{Binding ElementName=xTreeView,Path=SelectedItem}" IsDragDropEnabled="True"
                                                     telerik:PersistenceManager.StorageId="{Binding test,Mode=TwoWay}">
                                    <telerik:RadTreeView.ItemTemplate>                                       
                            <HierarchicalDataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <CheckBox IsChecked="{Binding IsChecked, Mode=TwoWay}"
                                              telerik:StyleManager.Theme="Office_Black" />
                                    <TextBlock VerticalAlignment="Center"
                                               Text="{Binding Name}" />
                                    <TextBlock Text="{Binding InfoTabItemsSourcePath}"
                                               Visibility="Hidden" />
                                </StackPanel>
                            </HierarchicalDataTemplate>
                        </telerik:RadTreeView.ItemTemplate>
                    </telerik:RadTreeView>​

Thank you.

Regards,

Prabakaran

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 19 Nov 2015, 05:25 PM
Hi Prabakaran,

I am not sure that I understand your case. When you enable the drag/drop behavior of RadTreeView the items dragging should be allowed in all sibling elements and in a parent element different than the dragged item's parent. Can you please send me a small example demonstrating the observed behavior and a description of the expected result? This will help me to understand your scenario better and assist you further. Thank you for any provided information.

As a side note, keep in mind that dropping an item into his parent is not allowed by the drag/drop behavior. If you want to override this behavior you can override the DragDropManager's events which are used for implementing the drag/drop logic in RadTreeView. You can find such examples in our help documentation.

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
Prabakaran
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or