JavaScript UI Libraries & Blazor Components Suite – Smart UI Forums Data Grid is there a way to add a class to a cell?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #108963
    edwardsmarkff
    Participant

    hello – i see setCellValue and setCellStyle – is there an addCellClass or something similar?

    Using something likeΒ  element.classList.add() does not appear to work as the class name is removed when the grid renders.

    also, i REALLY REALLY love using smart html elements grid! 😍

    • This topic was modified 8 months, 2 weeks ago by edwardsmarkff.
    #108965
    ivanpeevski
    Participant

    Hi edward,

     

    You can use column -> cellsClassName. You can set this to a function, which is called for each cell. For example:

    cellsClassName: (index, dataField, value, rowData, row) => { if (index === 0) { return ‘cell-class-1’ }

     

    Best Regards,
    Ivan Peevski

    Smart UI Team
    https://www.htmlelements.com/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.