When the user drags an item to the top or bottom of the TreeListView, I'd like to scroll automatically, to handle the case where the user wants to drag to an item that isn't currently in view. I have a small sample program I can provide you, and OnDragOver is shown below. Can you tell me how to detect that the drag has reached the top or bottom of the view and then scroll as needed?
Thanks,
Georg Hentsch
private void OnDragOver(object sender, Telerik.Windows.DragDrop.DragEventArgs e) {
var dropTarget = e.OriginalSource as TreeListViewRow ?? (e.OriginalSource as FrameworkElement).ParentOfType<TreeListViewRow>();
var details = DragDropPayloadManager.GetDataFromObject(e.Data, "DropDetails") as DropIndicationDetails;
if (dropTarget == null || details == null) {
return;
}
details.CurrentDraggedOverItem = dropTarget.DataContext;
if (details.CurrentDraggedItem == details.CurrentDraggedOverItem) {
e.Effects = DragDropEffects.None;
e.Handled = true;
return;
}
details.CurrentDropPosition = GetDropPositionFromPoint(e.GetPosition(dropTarget), dropTarget);
if (IsChildOf(dropTarget, sourceItem)) {
e.Effects = DragDropEffects.None; // don't allow item to be dropped to one of its own children
}
e.Handled = true;
}