New User (1st day)

Posted by: pbright-fp on 8 September 2017, 2:21 pm EST

  • Posted 8 September 2017, 2:21 pm EST

    I have gone through the documentation and was able to get this compoent to do everything that I wanted..  WOW

    However the very last thing..LOL... I can not figure out...

    I want to jump to a specific Cell in the active sheet at runtime and I need the active sheet to move to that position on screen if that cell is off screen and it needs to be highlighted that it is the selected cell.

    I thought this would do it but nothing happens....

    <FONT color=#a79a86 size=5><FONT color=#a79a86 size=5>

    </FONT></FONT><FONT size=4><FONT color=#e8e8e8><FONT color=#000000 size=2>fpSpread1.ActiveSheet.SetActiveCell(1000, 1);  </FONT></FONT></FONT><FONT size=4><FONT color=#a79a86 size=5><FONT color=#a79a86 size=5>


     Can someone help...

  • Replied 8 September 2017, 2:21 pm EST


    After setting the cell as active you may show the cell using ShowActiveCell() method.


    fpSpread1.ShowActiveCell(FarPoint.Win.Spread.VerticalPosition.Center, FarPoint.Win.Spread.HorizontalPosition.Center)


    I hope it will help you.





  • Replied 8 September 2017, 2:21 pm EST

    Worked Perfectly!!!  Thanks yoo so much..... 

    How do you highlight the selected cell you just jumped to?   It's now moving to the position but there is no indicator in the cell of what that positon is...

  • Replied 8 September 2017, 2:21 pm EST

    This most likely is not the best way .. but only been in this component one day ..  LOL 

     private void MoveToActiveCell(
        int row,
               int col,
                System.Drawing.Color InActiveCelBackgroundColor,
                System.Drawing.Color InActiveCelFontColor,
                System.Drawing.Color ActiveCelBackgroundColor,
                System.Drawing.Color ActiveCelFontColor)
                //set previous selected cell back to normal
                fpSpread1.ActiveSheet.ActiveCell.BackColor = InActiveCelBackgroundColor;
                fpSpread1.ActiveSheet.ActiveCell.ForeColor = InActiveCelFontColor;

                //set active row and column
                fpSpread1.ActiveSheet.ActiveRowIndex = row;
                fpSpread1.ActiveSheet.ActiveColumnIndex = col;

                //set active cell
                fpSpread1.ActiveSheet.SetActiveCell(row, col);

               //move to location

                //set new active cell color
                fpSpread1.ActiveSheet.ActiveCell.BackColor = ActiveCelBackgroundColor;
                fpSpread1.ActiveSheet.ActiveCell.ForeColor = ActiveCelFontColor;

  • Replied 8 September 2017, 2:21 pm EST


    You can use the following code to highlight the selected cell only with BackColor and Border and then restoring the default BackColor and Border on leaving the cell. Code for the same is given below:


            FarPoint.Win.BevelBorder bevelbrdr = new FarPoint.Win.BevelBorder(FarPoint.Win.BevelBorderType.Raised, Color.Cyan, Color.DarkCyan);
            private void fpSpread1_LeaveCell(object sender, FarPoint.Win.Spread.LeaveCellEventArgs e)
                fpSpread1.Sheets[0].Cells[e.NewRow, e.NewColumn].BackColor = Color.Red;
                fpSpread1.Sheets[0].Cells[e.NewRow, e.NewColumn].Border = bevelbrdr;
                fpSpread1.Sheets[0].Cells[e.Row, e.Column].BackColor = fpSpread1_Sheet1.DefaultStyle.BackColor;
                fpSpread1.Sheets[0].Cells[e.Row, e.Column].Border = null;
            private void fpSpread1_Leave(object sender, EventArgs e)
                fpSpread1.Sheets[0].ActiveCell.BackColor = fpSpread1_Sheet1.DefaultStyle.BackColor;
                fpSpread1.Sheets[0].ActiveCell.Border = null;
            private void fpSpread1_Enter(object sender, EventArgs e)
                fpSpread1.Sheets[0].ActiveCell.BackColor = Color.Red;
                fpSpread1.Sheets[0].ActiveCell.Border = bevelbrdr;


    Hope this will help you. Thanks.

  • Replied 8 September 2017, 2:21 pm EST

Need extra support?

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

Learn More

Forum Channels