set grid row background color dynamically

Hi guys. In v14 I haven’t any problem to set the row background color dynamically but since I have upgrade my project in v24, it doesn’t work.
I use this code “grid.setClassNameGenerator(line → “line-valide”);” and in my css
.line-valide{
background-color: #adf5ab;
}
Thank you in advance for your help

While class name generator should still work, v24 introduced a part name generator as an alternative, which allows using global CSS to style the cells. The documentation has an example on how to use it: https://vaadin.com/docs/latest/components/grid#part-name-generator

Thanks a lot. the “part name generator” method works in my project.