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

How to drag ListViewItem to ScheduleView

1 Answer 74 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Rod Yager
Top achievements
Rank 1
Rod Yager asked on 22 Mar 2011, 03:22 PM
I have added drag capabilites to one of our listviews so that appointments can be dragged to the ScheduleView using the RadDragDropManager.

RadDragAndDropManager

 

 

.SetAllowDrag(resultListView, true);

 

 

 

 

RadDragAndDropManager.AddDragQueryHandler(resultListView, OnDragQuery);

 


For the most part everythiing works, but when I grab the scrollbar thumb on the listview and drag it down, it starts a drag operation on the selected listviewitem instead of scrolling down. Also happens when tryng to resize the listview columns.

Any idea how I can get this to react only when dragging the listviewitem within the listview?

Rod

1 Answer, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 22 Mar 2011, 03:32 PM
Hi Rod,

Instead of setting the AllowDrag attached property on the whole ListView, you could set it on the ListView items, for example using ItemContainerStyle:
<ListView ...>
    <ListView.ItemContainerStyle>
        <Style TargetType="ListViewItem">
            <Setter Property="telerik:RadDragAndDropManager.AllowDrag" Value="true" />
        </Style>
    </ListView.ItemContainerStyle>
</ListView>

You can keep the event handler on the ListView.

By the way, we have a similar example that uses a ListBox. It is worth checking, if you haven't seen it before. Go to http://demos.telerik.com/wpf/ and navigate to ScheduleView / Drag And Drop.

Kind regards,
Valeri Hristov
the Telerik team
Tags
ScheduleView
Asked by
Rod Yager
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Share this question
or