Sorting a Vaadin 10 Grid

A user can sort the data in a grid on a column by clicking the column header.
How can I emulate this click in Java code?

try changing the SortOrder fo Grid in server side, it should refresh the order in client/browser

Hello m sahil,
can you please share a line of code?

There is a grid.sort(List) method but it doesn’t work for me. Does it work for you?

Dennis Winter:
A user can sort the data in a grid on a column by clicking the column header.
How can I emulate this click in Java code?

See related tutorial guide at https://vaadin.com/docs/flow/components/tutorial-flow-grid.html#sorting