Inserting Rows (maintaining cell borders)

Posted by: griswald88 on 8 September 2017, 12:43 pm EST

  • Posted 8 September 2017, 12:43 pm EST

    I have many cell borders (i.e. page breaks) setup in my sheet and if I do a Row.Add, it inserts a new row, but without any of the cell borders that were setup on the other cells. What is the easiest way to insert/copy the cell borders without having to run thru the time consuming algorithm that determines where the cell borders (page breaks) go? Is this possible?
  • Replied 8 September 2017, 12:43 pm EST


    If you were to add the border to the Column object, then you would not have to do anything. Otherwise, you would need to loop the cells above/below the row being inserted to check each cell to find the cell with the border set and then set the same border in the new row's cell.

  • Replied 8 September 2017, 12:43 pm EST

    Actually, that would probably simplify a bunch. How do you set a specific border type in the column object. For example, I want a dashed lined to appear before a certain colum.
  • Replied 8 September 2017, 12:43 pm EST


    You can use code like the following.

        FpSpread1.Sheets(0).Columns(11).Border = <SPAN class=kwd>New</SPAN> FarPoint.Win.ComplexBorder(<SPAN class=kwd>New</SPAN> FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.Dashed), <SPAN class=kwd>Nothing</SPAN>, <SPAN class=kwd>Nothing</SPAN>, <SPAN class=kwd>Nothing</SPAN>)
Need extra support?

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

Learn More

Forum Channels