Row Select

Posted by: rossmc on 8 September 2017, 2:13 pm EST

  • Posted 8 September 2017, 2:13 pm EST

    <p>I have a spread with a single sheet. To get the appearance and behaviour correct I have created my own columnheader renderer and focus renderer. Further to this the OperationMode of the sheet is SingleSelect.</p><p>Unfortunately a right-click does not select a new row? In other words if I right-click on the sheet the row selection highlight does not move to the new row. As I'm sure hundreds have trtied to do before me, I want to have a context menu popup that is specific to the row the user right-clicked on, therefore I first need to get the row highlighted, then show my context menu.</p><p>How do I programmatically select a row when in SingleSelect mode? </p><p>Thanks </p>
  • Replied 8 September 2017, 2:13 pm EST

    <P>You can use the CellClick event to notify you of a right click in the Spread. Then you can programatically select the row you want in the Spread.</P>
    <P> Private Sub FpSpread1_CellClick(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.CellClickEventArgs) Handles FpSpread1.CellClick<BR>  If e.Button = Windows.Forms.MouseButtons.Right Then<BR>   FpSpread1.Sheets(0).ClearSelection()<BR>   FpSpread1.Sheets(0).SetActiveCell(e.Row, e.Column)<BR>   FpSpread1.Sheets(0).Models.Selection.SetSelection(e.Row, 0, 1, 1)<BR>  End If<BR> End Sub</P>
Need extra support?

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

Learn More

Forum Channels