This is a migrated thread and some comments may be shown as answers.

[Solved] Reset GridView Vertical Scroll Position

1 Answer 222 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sam Vanhoutte
Top achievements
Rank 1
Sam Vanhoutte asked on 02 Nov 2011, 05:06 PM
Hello guys,
I want to reset the scroll position (after manual scroll down) of a RadGridview after rebinding the grid (pagedCollectionView) with new data.

I have an on demand RadDataPager and when fetching the results (from a service) of the next page, the RadGridview scroll position remains the same. I would like the vertical scroll bar to be back at the top.

I might use ScrollIntoView but I get the exception (parameter count mismatch).

pagedCollection = retrievedData;
pagedCollection.MoveCurrentToFirst();
grv.ScrollIntoView(pagedCollection.CurrentItem, grv.Columns[0]);


Is there any working solution or am I missing something.

Thanks in advance

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 07 Nov 2011, 02:38 PM
Hello Sam Vanhoutte,


Please try the following code :
this.RadGridView1.ChildrenOfType<GridViewScrollViewer>().First().ScrollToTop();

Regards,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Sam Vanhoutte
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or