Grid doesnt show selected line

I am using a grid. But the selected line is not being highlighted. How can I activate this? I tried this: grid.setSelectionMode(SelectionMode.SINGLE); And i tried css like this:

.v-grid-row-selected {
background-color: blue;
}

Both didnt work.

v-grid-row-selected looks like Vaadin 8.

ok… good to know. chatgpt advice :smile: what is the v23 aproach? a lit renderer?

https://vaadin.com/docs/latest/components/grid/styling has information about styling v24+ for other versions you have to adapt it.

ok i somehow fail to understand or believe that in v23 you couldnt see selected rows out of the box. :slightly_smiling_face: But i will try to upgrade to v24 and then use the style guide. thank you knoobie!

It’s possible with v23, but the selector might look different.

this is what a selected row looks like in V10–V24:
image.jpg

not sure why that would not be showing for you?

Perhaps the Lumo styling isn’t working for you at all – do other components look like they do in our docs?

i changed the default colors to black design in the vaadin starter (https://start.vaadin.com/) when i began. so it looks different in colors. but the other elements work.

maybe i did something wrong with the css?

This is what it should look like with the Lumo Dark theme if that’s what you selected in Start
image.jpg

Does sound like something might be broken in your css if it doesn’t look like that

ok found it. the lumo-primary-color-10pct in the styles doesnt work well with an already dark (black) background. :slightly_smiling_face:

the select itself worked. fixed that