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

Drag And Drop into a list nested in a listview

1 Answer 101 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Patrick Emmisberger
Top achievements
Rank 1
Patrick Emmisberger asked on 30 Apr 2010, 05:16 PM
I've a window with a listbox on the left half and a listview on the right half. The DataTemplate of the listview is set to a template which contains a listbox, so for every row of the listview a new listbox is created. Now I want to drag an item from the left half of the window into one of the nested listboxes on the right half. The problem is, that the nested listboxes aren't registered as drop target zones, although the AllowDrop-prop is set to true. If I set the AllowDrop-Property of the listview to true, the DropQuery-Event is raised, but the e.Options.Destination is always the listview, not the listbox inside it.

Any help is appreciated.

Thanks

Patrick


1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 05 May 2010, 07:32 PM
Hello Patrick Emmisberger,

Can you try setting a ItemContainerStyle for the ListView, like so:
<Window.Resources>
         
<DataTemplate x:Key="Template">
    <ListBox >
        <ListBoxItem Content="{Binding Name}"/>
    </ListBox>
</DataTemplate>
 
<Style TargetType="ListViewItem" x:Key="Style">
    <Setter Property="telerikDragDrop:RadDragAndDropManager.AllowDrop" Value="True"/>
</
Style>
         
</Window.Resources>
 
 
<ListView ItemContainerStyle="{StaticResource Style}" ItemTemplate="{StaticResource Template}" x:Name="listView" />

This way in the DropInfo and DropQuery events the e.Options.Destination will point to the TreeViewItem.

Give it a try and let me know how it goes.

Best wishes,
Tina Stancheva
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Tags
DragAndDrop
Asked by
Patrick Emmisberger
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or