How to enable dropping item inside the treeviewitem

2 posts, 0 answers
  1. Prabakaran
    Prabakaran avatar
    14 posts
    Member since:
    Feb 2015

    Posted 16 Nov 2015 Link to this post

    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

  2. Martin
    Admin
    Martin avatar
    1101 posts

    Posted 19 Nov 2015 Link to this post

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