Backcolor priority between cells/rows/column

Posted by: giavardistefano78 on 19 February 2018, 11:11 am EST

    • Post Options:
    • Link

    Posted 19 February 2018, 11:11 am EST

    Hi. Is there a way to give priority to cell backolor over row/column backcolor in Spread8?

    I mean, if I change the background color of a column the new color goes above / override the color of cells of that column.

    On the other hand if I set the backcolor on a whole row (col = -1) it wins on column color changes. Row wins on column but cells are the loosers.

    I think that if I specify a gh color for a cell as a marker (this is the main use, like a sort of conditional formatting) I want to keep it over any other coloring, or at least i should be an option… Don’t you think so?

    The only way I found is to pass all cells and apply the column color one by one only if the cell backcolor is blank, losing the advantage of setting Row = -1

    Thanks.

  • Posted 19 February 2018, 10:38 pm EST

    Hello,

    Setting the backcolor with code Row/Column =-1 is equivalent to setting backcolor for individual cells in loop. Please have a look at the precedence order in the documentation here:

    http://help.grapecity.com/spread/Spread8/WebSiteHelp/webframe.html#spcont22.html

    Individual cells have the highest precedence. For example, if you set the background color for cell B2 to red and the background color of row 2 is blue, the background color of column 2 is white, and the background color of the sheet is gray, the cell would display the color set for it (red), not for the row, column, or sheet.

    Thanks,

    Deepak Sharma

  • Posted 20 February 2018, 1:44 am EST

    Ok but something is strange… It depends half on the sequence of setting colors…

    FPS_Spread>>Row(5)

    FPS_Spread>>Col(-1)

    FPS_Spread>>BackColor(PastelYellow) // ROW

    FPS_Spread>>Row(-1)

    FPS_Spread>>Col(10)

    FPS_Spread>>BackColor(PastelRed) // COL

    // THIS SEQUENCE RETURNS YELLOW ON CELL [5,10]

    FPS_Spread>>Row(-1)

    FPS_Spread>>Col(10)

    FPS_Spread>>BackColor(PastelRed) // COL

    FPS_Spread>>Row(5)

    FPS_Spread>>Col(-1)

    FPS_Spread>>BackColor(PastelYellow) // ROW

    // EVEN THIS SEQUENCE RETURNS YELLOW ON CELL [5,10]

    So here the row wins always over the column. Now…

    FPS_Spread>>Row(5)

    FPS_Spread>>Col(10)

    FPS_Spread>>BackColor(PastelCyan) // CELL

    FPS_Spread>>Row(-1)

    FPS_Spread>>Col(10)

    FPS_Spread>>BackColor(PastelRed) // COL

    FPS_Spread>>Row(5)

    FPS_Spread>>Col(-1)

    FPS_Spread>>BackColor(PastelYellow) // ROW

    // THIS SEQUENCE RETURNS YELLOW ON CELL [5,10]

    FPS_Spread>>Row(-1)

    FPS_Spread>>Col(10)

    FPS_Spread>>BackColor(PastelRed) // COL

    FPS_Spread>>Row(5)

    FPS_Spread>>Col(10)

    FPS_Spread>>BackColor(PastelCyan) // CELL

    FPS_Spread>>Row(5)

    FPS_Spread>>Col(-1)

    FPS_Spread>>BackColor(PastelYellow) // ROW

    // EVEN THIS SEQUENCE RETURNS YELLOW ON CELL [5,10]

    FPS_Spread>>Row(-1)

    FPS_Spread>>Col(10)

    FPS_Spread>>BackColor(PastelRed) // COL

    FPS_Spread>>Row(5)

    FPS_Spread>>Col(-1)

    FPS_Spread>>BackColor(PastelYellow) // ROW

    FPS_Spread>>Row(5)

    FPS_Spread>>Col(10)

    FPS_Spread>>BackColor(PastelCyan) // CELL

    // THE ONLY WAY TO KEEP CYAN ON THE CELL IS THIS SEQUENCE

    // OR SWAPPING THE BLOCK FOR COL E ROW…

    The cell color setting must be the last one otherwise the cell is overwritten by the row or column color. It seems that the cell is the weakest priority…

    I’m missing something?

  • Posted 22 February 2018, 1:16 am EST

    Hello,

    This is current default behavior. You would need to set the color of the cell in order to persist with the same.

    Thanks,

    Deepak Sharma

  • Posted 22 February 2018, 8:35 am EST

    How can I set the color of the cell?

    I read

    FPS_Spread>>Row(5)

    FPS_Spread>>Col(10)

    FPS_Spread>>BackColor(PastelCyan) // CELL

    but a following

    FPS_Spread>>Row(-1)

    FPS_Spread>>Col(10)

    FPS_Spread>>BackColor(PastelRed) // COL

    or

    FPS_Spread>>Row(5)

    FPS_Spread>>Col(-1)

    FPS_Spread>>BackColor(PastelYellow) // ROW

    will destroy it.

  • Posted 23 February 2018, 1:44 am EST

    Hello,

    I would suggest you to use

    FPS_Spread>>Row(5)

    FPS_Spread>>BackColor(PastelYellow) // ROW

    And

    FPS_Spread>>Col(10)

    FPS_Spread>>BackColor(PastelRed) // COL

    To set backcolor for row and column. This way cell will override the settings. Let me know if does not help you.

    Thanks,

    Deepak Sharma

  • Posted 23 February 2018, 8:02 pm EST

    Sure in this way the row wins but not the single cell.

    I try to explain the use of this.

    A column could contain an important data for the customer and he wants to keep it highlighted.

    But if a cell has bg formatting for higlighing a condition (for example a new price, or data changes) and the user set another color on the column it destroys the cell highlighing.

    To keep it now I need to set the column color and the scan all the cells to re-apply the bgcolor formatting if they had one. Or ciclying the rows when coloring the column to skip the cells that has their own bg color.

  • Posted 6 March 2018, 8:09 pm EST

    Hi,

    Like you mentioned earlier, you would currently need to follow the below sequence:

    FPS_Spread>>Row(-1)

    FPS_Spread>>Col(10)

    FPS_Spread>>BackColor(PastelRed) // COL

    FPS_Spread>>Row(5)

    FPS_Spread>>Col(-1)

    FPS_Spread>>BackColor(PastelYellow) // ROW

    FPS_Spread>>Row(5)

    FPS_Spread>>Col(10)

    FPS_Spread>>BackColor(PastelCyan) // CELL

    However, let me discuss the case to see if there is anything that can be done so that cell color prevails irrespective of sequence {Tracking ID: 254955}. I will get back to you soon on this.

    Thanks,

    Ruchir Agarwal

Need extra support?

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

Learn More

Forum Channels