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

  • Posted 8 September 2017, 2:20 pm EST

    Hi, Iam trying to set the verticalGridLines to be black and the horizontal lines to be gray with the following two lines of code. But the problem is because of the horizontal lines, there is a gap between each cell for the verticalgridlines. if I make the width of the horizontal line to be zero, it works but the horizontal lines vanish (for obvious reason). So, How can I tackle this situation ? I want dark vertical lines with no gaps and gray horizonallines.

    .Sheets(0).VerticalGridLine = New FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.Flat, Color.Black, Color.Black, Color.Black, 1.5)

    .Sheets(0).HorizontalGridLine = New FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.Flat, Color.LightGray, Color.LightGray, color.LightGray, 0.6)

    Any help is apreciated.


  • Replied 8 September 2017, 2:20 pm EST


    Spread paints the grid lines in the following order: vertcial lines, horizontal lines.  If the lines are different colors then you will get the appearance of gaps in the vertical lines where the horizontal lines are painted over the vertical lines.  There are no options for reversing the painting order of the grid lines.

    Spread paints cell borders on top of the grid lines.  You could achieve the look you want by leaving the grid lines their default gray color and then adding a black cell border on the right side of all cells.  This could be done using an instance of the LineBorder class...

        fpSpread1.Sheets[0].DefaultStyle.Border = new FarPoint.Win.LineBorder(Color.Black, 1, false, false, true, false);

    or an instance of the ComplexBorder class...

        fpSpread1.Sheets[0].DefaultStyle.Border = new FarPoint.Win.ComplexBorder(null, null, new FarPoint.Win.ComplexBorderSide(Color.Black, 1), null);

Need extra support?

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

Learn More

Forum Channels