Implemented the behavior to adjust the scroll position so that the selected item will appear on the top in the view.
code for above behavior:
var scrollOffset = gridView.Items.IndexOf(SelectedItem) * gridView.RowHeight;
var scrollViewer = gridView.ChildrenOfType<Telerik.Windows.Controls.GridView.GridViewScrollViewer> ().First();
// scrollbar position
var verticalOffset = scrollViewer.VerticalOffset;
var viewportHeight = scrollViewer.ViewportHeight;
if (scrollOffset > verticalOffset || scrollOffset > (verticalOffset + viewportHeight))
{
scrollViewer.ScrollToVerticalOffset(scrollOffset);
}
11 items are there in the view. If 3rd last item is selected.
Steps performed to reproduce the issue:
1. Scrolled down to the bottom.
2. restarted the application and opened the view which contains radgridview.
3. above code for scroll item to top executed on the loading of radgridview.
4. please refer the attached image which shows issue.
Disappeared row appears again on scrolling the radgridview.
If Virtualization row is turned off, this issue does not reproduce but it kills the performance.
Need to get another solution for this issue.
Thanks for the solution.
I have share code snippet in above question.
Can you tell me when do you execute the above mentioned code? I mean what event or on what action do you call the logic?
In the meantime, you can try to save the VerticalOffset of the ScrollViewer when the Sorting event is fired and then restore it on Sorted.