highlight the spread sheet cell

Posted by: veera6681 on 8 September 2017, 2:19 pm EST

  • Posted 8 September 2017, 2:19 pm EST

     im  using the farpoint spreadsheet in my c# windows application..

    i want search a particular cell in that spread sheet.. i wrriten a code for search but i dont know how to highlight the cell..

    i used the following code but its not highlighting the cell...

                  fpspr.ActiveSheet.Cells[iRowIndex, iColIndex].BackColor) == System.Drawing.Color.LightBlue;

    HOW TO HIGHLIGHT THE CELL WHILE SEARCHING IN SPREAD SHEET

     

    thanks in advance

     

  • Replied 8 September 2017, 2:19 pm EST

    Hello,

    You may use Spread's Search( ) method in order to perform a search for some string it returns you the Row and Column index for the searched string. Have a look at the below example:

            Dim x As Integer
            Dim y As Integer
            Dim str As String
            str = ""
            str = TextBox1.Text
            Dim sff As FarPoint.Win.Spread.SearchFoundFlags
            sff = FpSpread1.Search(0, str, True, True, False, False, True, False, False, True, 0, 1, 3, 3, x, y)
            FpSpread1.ActiveSheet.SetActiveCell(x, y)
            FpSpread1.ActiveSheet.Cells(x, y).BackColor = Color.Blue 

    I hope it will help you.

    Thanks,

     

  • Replied 8 September 2017, 2:19 pm EST

    thank u depak..
Need extra support?

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

Learn More

Forum Channels