getRowStyle(params) { return { background-color: 'red !important'} }
Property is invalid when it has hyphens in-between (background-color) change it to backgroundColor and it works great!
background-color
backgroundColor
getRowStyle: (params) => { return { backgroundColor: 'red !important'} },
Working Plunkr
The following code may be useful if you want to specify the background color for a specific cell.
{ field: 'name', headerName: 'Name', cellStyle: (params) => { if (condition) { return { backgroundColor: 'red' }; } return defaultStyle } }
Property is invalid when it has hyphens in-between (
background-color) change it tobackgroundColorand it works great!Working Plunkr