RowDragOver Event?

Posted by: chic00 on 8 September 2017, 1:01 pm EST

  • Posted 8 September 2017, 1:01 pm EST

    I am trying to find a way to get the current row being dragged over on a within-Spread drag operation.  I see this can be done when dragging something from outside of Spread and using the DragOver/GetCellFromPixel method... however I am working with the Spread RowDragMove/RowDragCompleted events.  Is there an existing way to accompish something like this?

  • Replied 8 September 2017, 1:01 pm EST

    There is nothing in either of these events that will return a row you are dragging over during the drag.
  • Replied 8 September 2017, 1:01 pm EST

    Gotcha.  I am just trying to find a way to accomplish this using something built-in.  Is it possible?
  • Replied 8 September 2017, 1:01 pm EST

    There's nothing really built in.  You could try using the MouseMove event but I can't really think of a good method that would return the row you are over.
  • Replied 8 September 2017, 1:01 pm EST

    Hello,


    I would suggest using the HitTest method to get this information.

  • Replied 8 September 2017, 1:01 pm EST

    Here is some code to return the row (via Scott)...

    Dim flag As Boolean
      Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles MyBase.Load
        FpSpread1.AllowRowMove = True
        flag = False
      End Sub


      Private Sub FpSpread1_MouseMove(ByVal sender As Object, ByVal e As
    System.Windows.Forms.MouseEventArgs) Handles FpSpread1.MouseMove
        If flag Then

          Dim htInfo As FarPoint.Win.Spread.HitTestInformation
          Dim pt As New Point(FpSpread1.PointToClient(New Point(Control.MousePosition.X, Control.MousePosition.Y)))
          htInfo = FpSpread1.HitTest(pt.X, pt.Y)
          If Not htInfo Is Nothing Then
            If htInfo.Type = FarPoint.Win.Spread.HitTestType.RowHeader Then
              Debug.WriteLine(htInfo.HeaderInfo.Row)
            End If
            If htInfo.Type = FarPoint.Win.Spread.HitTestType.Viewport Then
              Debug.WriteLine(htInfo.ViewportInfo.Row)
            End If
          End If
        End If

      End Sub

      Private Sub FpSpread1_RowDragMove(ByVal sender As Object, ByVal e As
    FarPoint.Win.Spread.DragMoveEventArgs) Handles FpSpread1.RowDragMove
        flag = True
      End Sub

      Private Sub FpSpread1_RowDragMoveCompleted(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.DragMoveCompletedEventArgs) Handles FpSpread1.RowDragMoveCompleted
        flag = False
      End Sub

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels