Posted 29 September 2023, 12:00 am EST
- Updated 29 September 2023, 12:11 am EST
Hi,
To accomplish this, you can employ the item formatter to insert your customized CSS class into the cells that require a style modification. Subsequently, you can then apply CSS rules to this class. Please consult the provided code snippet and accompanying sample, which illustrates the process of highlighting cells with even values in the third column.
// Define a function to format the grid cells
function pivotItemFormatter(panel, row, col, cell) {
let binding = panel.columns[col].binding;
// Check if the cell type is 'Cell'
if (panel.cellType === wijmo.grid.CellType.Cell) {
// Get the value from the data source
let value = panel.grid.collectionView.sourceCollection[row][binding];
// Check if the column index is 2 and the value is even
if (col === 2 && value % 2 === 0) {
// Add a custom class to the cell for styling
wijmo.addClass(cell, 'custom-class');
}
}
}
Regards,
Avinash
highlight_cells.zip