I have a grid view that is data bound to a collection of objects, The grid gets refreshed every 30 seconds, we are getting he data from rest service and we create new objects for every refresh.
If user selects a row, I want to keep that selection after the refresh, I have my own logic to remember the last item and after the itemsource is updated I set the selectedItem to the previously selecteditem
But the problem is that after the data is loaded there is a selected item change event raised by the grid and it sets the selection to first row, I know this is because i have set IsSynchronizedWithCurrentItem="True", But i need that to show the row indicator, Also if i do not set that to true the row is selected but it does not have any focus, I mean visually you can tell that the row is selected it does not have the border or selected item color.
Is there any way that I can keep IsSynchronizedWithCurrentItem="True" and also set the selected item after the refresh and after the grid has raised its last selected item changed event.
The order of events is like this
- Update collection, - i set previous item - grid set the item to null - then grid set the item to first row