Cell questions

Posted by: rene1983 on 8 September 2017, 2:35 pm EST

  • Posted 8 September 2017, 2:35 pm EST

    I';m using Spread for Win Forms 5 and I have a couple of questions...

    1. Can a sheet be created and not set the focus onto any any cell?  I want to populate a spread and not highlight any cell until the user picks one.

     2. Is is possible to change the style of the border of a selected cell?  I want to create a more subtle appearance to selected cells. 

     I've scoured these forums and  can't seem to find these answers.

    Thank you in advance!

  • Replied 8 September 2017, 2:35 pm EST

    Hello,

    In order to have the get away with the cell focus when the Spread is rendered for the first time you need to set Spread's FocusRenderer property to null and then  set it to SolidFocusIndicatorRenderer as soon as you enter the Spread using Spread's Enter event. Please have a look at the code for the same.

            private void Form2_Load(object sender, EventArgs e)

            {

                fpSpread1.FocusRenderer = null;

                fpSpread1.Enter += new EventHandler(fpSpread1_Enter);

            }

     
           void fpSpread1_Enter(object sender, EventArgs e)

            {

                fpSpread1.FocusRenderer = new FarPoint.Win.Spread.SolidFocusIndicatorRenderer(Color.Black, 2);

            }

    And for changing the style of the borders of a selected cell, you can set the cells border to particular style of Cell border.

                FarPoint.Win.BevelBorder bevelbrdr = new FarPoint.Win.BevelBorder(FarPoint.Win.BevelBorderType.Raised, Color.Red, Color.Green);

                // Set the bevel border to the cell B3 border.

                fpSpread1.Sheets[0].Cells[3,3].Border = bevelbrdr;

    You can have a look at the 'Customizing Cell Borders' topic in  our online product documentation at this link wherein different border styles have been discussed:- http://www.clubfarpoint.com/FarPointSupportSite/Modules/Docs/SpreadWin5Help/index.html

    Hope this will help you. Thanks.

  • Replied 8 September 2017, 2:35 pm EST

    Hello,

    In addition to what Reeva stated, here is the correct documentation link for this article:
    http://www.clubfarpoint.com/FarPointSupportSite/Modules/Docs/SpreadWin5Help/spwin-cellborder.html

  • Replied 8 September 2017, 2:35 pm EST

    Hi,

    In regards to 2, I think using a custom FocusIndicatorRenderer might be what you are looking for.  You can create a class which implements IFocusIndicatorRenderer with code in the Paint method to draw the focus indicator for the cell, then set an instance of that class to FpSpread.FocusRenderer.

Need extra support?

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

Learn More

Forum Channels