Highlighting SelectedRow

Posted by: hpadmasola1 on 8 September 2017, 2:18 pm EST

  • Posted 8 September 2017, 2:18 pm EST

    <FONT size=2>
    <P>I want to be able select the complete row and also highlight the selected row in Yellow. I tried the following two lines of code. It does not seem to work. is the code below correct ? Any guidance is appreciated.</P>
    <P>fpSpread1.Sheets(0).SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Row</P>
    <P>fpSpread1.Sheets(0).SelectionBackColor = Color.Yellow</P>
    <P> Thanks</P>
    <P>Harish</P></FONT>
  • Replied 8 September 2017, 2:18 pm EST

    <P>Hello Harish,</P>
    <P>You need to set SelectionStyle property of Sheets to SelectionColors as well along with other properties.</P>
    <BLOCKQUOTE>
    <P>            fpSpread1.Sheets(0).SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Row<BR>            fpSpread1.Sheets(0).SelectionStyle = FarPoint.Win.Spread.SelectionStyles.SelectionColors<BR>            fpSpread1.Sheets(0).SelectionBackColor = Color.Yellow</P></BLOCKQUOTE>
    <P>Hope this will help you. Thanks.</P>
  • Replied 8 September 2017, 2:18 pm EST

    <P>This worked but the Selected Cell is still in white. I want the whole row to be in yellow including the selected cell.  How do I make that yellow as well ?</P>
    <P>harish</P>
  • Replied 8 September 2017, 2:18 pm EST

    <p>Hello Harish,</p><p>In addition to the above code you may add the some code in Spread's LeaveCell event to set the backcolor for selected cell and to reset it while leaving the cell.</p><p>    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br>        FpSpread1.Sheets(0).SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Row<br>        FpSpread1.Sheets(0).SelectionStyle = FarPoint.Win.Spread.SelectionStyles.SelectionColors<br>        FpSpread1.Sheets(0).SelectionBackColor = Color.Yellow<br>    End Sub<br><br>    Private Sub FpSpread1_LeaveCell(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.LeaveCellEventArgs) Handles FpSpread1.LeaveCell<br>        FpSpread1.ActiveSheet.Cells(e.NewRow, e.NewColumn).BackColor = Color.Yellow<br>        FpSpread1.ActiveSheet.Cells(e.Row, e.Column).BackColor = Color.White<br>    End Sub</p><p>I hope it will help you.</p><p>Thanks,</p><p> </p>
Need extra support?

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

Learn More

Forum Channels