Problem editing element in ordered grid

I have a problem when pressing the element's edit button in a previously ordered grid, the grid is rendered and takes the default order, losing the element I am editing.
In the demo page it doesn't happen.

Not sure what this means however most probably the DataGrid is bound using an expression that is evaluated on every state change resulting in not able to keep state. For example Data=@(orders.OrderBy(o => o.Id))

When I load from db the spreadsheet has a default order (in this case order by element id). I dont do .OrderBy(o => o.Id) i just load the db.
So for example when I order by specific column and then want to edit a certain element the spreadsheet realoads to it's default order.