Coloring Hearders

Posted by: fhcnunes-fp on 8 September 2017, 12:48 pm EST

  • Posted 8 September 2017, 12:48 pm EST

    Hello,
    I am having a problem to color headers. In my application, I have a method to color headers. When I open a new spread, the headers of active cell are colored with orange color correctly. File NewSpread.JPG show this where the cell A1 is the active cell.

    The problem occurs when I try to open a file. When I do this, the headers are colored, but the spread is opened with headers do not modified. I am sending two files to illustrate it. File LastCommand.JPG shows the execution of my application. It is the last command to be executed before that the spread be showed to the user. As it can be seen, the active cell headers are colored with orange color. But the final result has no header colored (File OpenSpread.JPG).

    Is there some event that avoids this modification in headers? Do you know what could be happening?
    Thanks.

    2007/09/Headers.zip
  • Replied 8 September 2017, 12:48 pm EST

    Hello,


    Make sure you have the latest maintenance release of Spread for Windows Forms if you are using version 3. Or you can set the VisualStyles property off.

  • Replied 8 September 2017, 12:48 pm EST

    Thank you too much.
    VisualStyles property value was not set off.
    Now it is working.

  • Replied 8 September 2017, 12:48 pm EST

    fhcnunes -

    What type of file are you opening?  Are you trying to open it in the spread that has the orange headers?  If so, opening the file will overwrite the headers.  You would need to change the colors after you open the file.
  • Replied 8 September 2017, 12:48 pm EST

    I know this. I am trying to change the colors after to open the file.
    Because of it I am thinking very strange this situation.
    Is there another situation to this error?
    Remember: this situation happens just when I try to open a existing file.
    Thanks.
  • Replied 8 September 2017, 12:48 pm EST

    I can't think of anything that would prevent you from doing this.  Do you have a small sample reproducing this you could attach for us to debug?
  • Replied 8 September 2017, 12:48 pm EST

    Hello,
    There are still diferences between a new spreadsheet and a spreadsheet when I open a file.

    When I open the application with a new spreadsheet, the headers are colored correctly and all your space is colored as you can see in file HeadersWithoutShadow.JPG.

    But, when I try to open a file, the space of headers is not colored completely. It looks that there are a kind of shadows (see file HeadersWithShadow.JPG).

    I would like to remove such shadows. What method do I need to change? What do I need to do?
    Thanks.

    2007/09/Headers-2.zip
  • Replied 8 September 2017, 12:48 pm EST

    Hello,


    What code are you using for setting the color for the header. I tested this, and always got the shadow that you are seeing. I could not get a flat header. Do you have any system colors set to this same Orange? Could you post a small zipped project reproducing this behavior for us to debug?

  • Replied 8 September 2017, 12:48 pm EST

    To solve header color problem is necessary to set the methods ColumnHeader.HorizontalGridLine, ColumnHeader.VerticalGridLine, RowHeader.HorizontalGridLine and RowHeader.VerticalGridLine of each sheet to
     
    New FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.Raised, System.Drawing.Color.LightGray, System.Drawing.Color.Empty, System.Drawing.SystemColors.ControlDark)
     
    My result is reached at this way.
Need extra support?

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

Learn More

Forum Channels