This example demonstrates how to scroll grid rows and columns when dragging an object near the grid's edge.
See also:
Drag&drop - Auto-scroll the grid when dragging near its edges
How to automatically scroll the LayoutView during drag-and-drop
Question Comments
Added By: Julien C. at: 8/6/2013 2:16:23 AM
Hello,
I am sorry, I am having a hard time understanding what "gridView1" stands for in your current example. I created a gridControl, set its datasource, and have been using one view. How do i get the LayoutView from the GridView?
Thank you for your help.
Added By: Julien C. at: 8/6/2013 2:22:42 AMJust to be clear: i am not trying to present records as cards (layoutview) but to implement the simplest form of autoscroll when performing drag and drop on a grid. Thanks
Added By: Kosmo14 at: 8/20/2013 2:56:34 PMIs there a WPF (instead of winforms) solution to this also?
Added By: avian_johnson at: 12/4/2015 2:21:43 AMHello,
Thanks for this auto scroll code.
It works good for right, left and bottom drag. But there is a wrong condition for top drag in AutoScrollHelper.cs.
this is the condition which not worked for me.
fScrollInfo.GoUp = (pt.Y < rect.Top + ThresholdInner) && (pt.Y > rect.Top - ThresholdOutter);
I have corrrected it & now it is working for me.
Modified Condition :
fScrollInfo.GoUp = (pt.Y > rect.Top - ThresholdInner) && (pt.Y < rect.Top + ThresholdOutter);
Thank You
Added By: David Shannon at: 8/7/2016 3:29:43 PM Two questions:(1) Is the sample code for stopping the scrollTimer correct? It looks like it would make it stop unless the grid needed to scroll in all directions at once, which is never true. In other words, it always stops the scrollTimer.
If Not (GoDown AndAlso GoLeft AndAlso GoRight AndAlso GoUp) Then
scrollTimer.Stop()
End If
(2) Will autoscrolling when dragging ever be built into the grid and tree? It seems like something that should automatically happen without all this.