Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
370
Scroll speed
posted

Hi,

I'm coding a drag/drop operation on an ultrawingrid. On the DragOver event I check if my mousecursor is close to the borders. If so a scroll action is performed.

' Check if we need to scroll up/down in the grid

If (pointInGridCoords.Y < 20) Then

    TicketLinesUGrid.ActiveRowScrollRegion.Scroll(RowScrollAction.LineUp)  ' Scroll up

ElseIf (pointInGridCoords.Y > TicketLinesUGrid.Height - 20) Then

    TicketLinesUGrid.ActiveRowScrollRegion.Scroll(RowScrollAction.LineDown) ' Scroll down

End If

This works fine but in some cases a litlle bit to fast. Is there a way to implement such functionality that depending on how close you go to the edge of the control the faster the scroll is performed

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    There's nothing built-in to the grid to do this. But what I would do is use a Timer. So instead of putting the code that scrolls the grid into the DragOver event, all the DragOver event would do is set the Interval and start a Timer. When the Timer_Tick fires, you scroll. You would have to keep some kind of flag about which direction to scroll, of course.

Children