JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Data Grid › is there a way to add a class to a cell?
hello – i see setCellValue and setCellStyle – is there an addCellClass or something similar?
setCellValue
setCellStyle
addCellClass
Using something likeΒ element.classList.add() does not appear to work as the class name is removed when the grid renders.
element.classList.add()
also, i REALLY REALLY love using smart html elements grid! π
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/