Cant set backColor and hover over comment to a specific cell in the header

Posted by: adityav on 20 July 2023, 5:58 pm EST

    • Post Options:
    • Link

    Posted 20 July 2023, 5:58 pm EST - Updated 20 July 2023, 6:05 pm EST

    In the attached Image there are N number of columns. The header columns which are in grey color are static and the columns with Date and Year titles are dynamic. I want to add background color and hover over comment to a specific column with the date and year title (Pointed with an arrow in the attached image).

    Using the below line i am trying to set the color but its not working:

    this.activeSheet.getCell(0, 82, .Spread.Sheets.SheetArea.colHeader).backColor(“Yellow”)

    To verify if " this.activeSheet

    .getCell(0, this.staticList.length + j, GC.Spread.Sheets.SheetArea.colHeader)" is getting the correct cell i tried this.activeSheet

    .getCell(0, this.staticList.length + j, GC.Spread.Sheets.SheetArea.colHeader).text() and it gives me the “Aug 4 2023” which is the cell i wanted but its not setting the background color to the header cell.

    And on top of it i am trying to set hover over comment to the same header cell but its setting the comment to the cell right below it.

    I used the same code to set the color to red of a different column(column 3 with title “Comments” in the image attached) and it worked as expected.

    Any help would be appreciated.

  • Posted 21 July 2023, 5:15 am EST - Updated 21 July 2023, 5:22 am EST

    Hi Aditya,

    Background Color Issue: I was unable to replicate the issue at my end. I tried creating a sample and then adding the columns via a button (dynamic columns), and the background color seems to be working fine at my end.

    You could refer to the following sample that I have used for testing: https://jscodemine.grapecity.com/share/YakB3cSROkiFZ3fQbEfdww/?IsEmbed=false&Theme=Unset&PreviewDirection=0&IsEditorShow=true&IsExplorerShow=true&IsPreviewShow=true&IsConsoleShow=true&IsRunBTNShow=false&IsResetBTNShow=false&IsOpenInCodemineBTNShow=false&PanelWidth=20&PanelWidth=50&PanelWidth=30&defaultOpen={"OpenedFileName"%3A["%2Fapp.js"%2C"%2Findex.html"]%2C"ActiveFile"%3A"%2Fapp.js"}

    Could you kindly share us a sample replicating the issue? You could also modify the above sample if you have a different implementation than ours and share it with us. Without the sample replicating the issue, it would be hard for us to comment on the nature and cause of the issue.

    Comments Issue: Currently, the comments can be added only to the viewport cells and not to the column header and row header cells. This is the same behavior as Microsoft Excel.

    Regards,

    Ankit

Need extra support?

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

Learn More

Forum Channels