Right Click on the Farpoint Grid.

Posted by: bharath-ron on 8 September 2017, 1:21 pm EST

  • Posted 8 September 2017, 1:21 pm EST

    Hello All,

     

    I am having a grid which is being loaded with data, i want to select multiple rows which i will do by dragging mouse over the rows. when i right click on the grid only one row will be selected , i need to select all the rows which i have selected.

     

    Note. grid rows actually sheets not rows ..

     

    Thanks in advance

    Bharath
     

  • Replied 8 September 2017, 1:21 pm EST

    Bharath,


    Here is some code I implemented for selecting rows of the Spread on a right click.


    Dim flag As Boolean


    Dim startrow As Integer


    Dim anchorrow As Integer


    Dim endrow As Integer


    Private Sub FpSpread1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles FpSpread1.MouseDown


    If e.Button And Windows.Forms.MouseButtons.Right Then


    flag = True


    FpSpread1.Sheets(0).Models.Selection.ClearSelection()


    startrow = FpSpread1.GetCellFromPixel(0, 0, e.X, e.Y).Row


    anchorrow = FpSpread1.GetCellFromPixel(0, 0, e.X, e.Y).Row


    endrow = FpSpread1.GetCellFromPixel(0, 0, e.X, e.Y).Row


    End If


    End Sub


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


    Dim tempRow As Integer


    Dim rc As Integer


    If flag = True Then


    tempRow = FpSpread1.GetCellFromPixel(0, 0, e.X, e.Y).Row


    If tempRow < startrow Then


    anchorrow = tempRow


    endrow = startrow


    ElseIf tempRow > startrow Then


    endrow = tempRow


    Else


    anchorrow = startrow


    endrow = startrow


    End If


    rc = endrow - anchorrow + 1


    FpSpread1.Sheets(0).Models.Selection.SetSelection(anchorrow, 0, rc, FpSpread1.Sheets(0).ColumnCount)


    End If


    End Sub


    Private Sub FpSpread1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles FpSpread1.MouseUp


    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