We have a requirement that needs to refresh XamDataGrid to load new data, then scroll to the previously selected row. User can see grid flickering during the refresh. Is there a way to delay display the grid until the grid scrolled to the correct position? In winform grid, there are BeginUpdate and EndUpdate method. Are there similar methods for XamDataGrid?
Thanks,
Crystal.
Hi Mike, I set it when re-selected previously selected row. I have to set it again in RecordsInViewChanged event handler, which works, but it can cause grid flicker.
Hello Crystal,
Thank you for the update. It sounds like it may be a timing issue, When are you calling/setting it?
Hi Mike, any idea on why scrollInfo.ScrollOwner.ScrollToVerticalOffset doesn't work everytime. Invoking SetVerticalOffset with a dispatcher works every time, but it caused grid flicker.
Crystal
After more thorough testing, I found that scrollInfo.ScrollOwner.ScrollToVerticalOffset doesn't work all the time. Invoking SetVerticalOffset with a dispatcher works every time, but it caused grid flicker.
Any suggestions?
Hi Mike,
I used scrollInfo.SetVerticalOffset(_previousScrollbarVerticalOffset);by looking at other post, I found out scrollInfo.ScrollOwner.ScrollToVerticalOffset(_previousScrollbarVerticalOffset); fixed the issue.