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

[Solved] Programatically Scroll Page

5 Answers 117 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.
Alessandro
Top achievements
Rank 1
Alessandro asked on 18 Feb 2011, 04:04 PM
Hi, I already know how to get to the GridScrollViewer using

GridViewScrollViewer scrollViewer = grd.grdSrchResults.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault();

What I need to know is how do I scroll page by page from there?  I don't want to scroll to the end but it seems that the GridViewScrollViewer is lacking methods like ScrollToNext() and ScrollToPrev() as if the user clicked an are on the scrollbar.

Thanks for any help here.

 -- xavier

5 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 22 Feb 2011, 01:59 PM
Hi Xavier,

I am sending you a sample project that describes an approach of scrolling horizontally and vertically in a RadGridView using specified scrolling offsets. Feel free to modify these values in order to fit best into your requirements.

Regards,
Ivan Ivanov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Alessandro
Top achievements
Rank 1
answered on 03 Mar 2011, 02:39 PM
Hi Ivan, this example only provides the web project. Can you provide the entire project? Thanks!
 -- xavier
0
Rossen Hristov
Telerik team
answered on 03 Mar 2011, 02:51 PM
Hi Xavier,

That is very weird.

I have just downloaded the attached archive and here is what I see when I open it and go one level down.

Can you check again? There is one folder in the archive called SilverlightApplication64. When you go inside it -- what do you see. Is it different from my screen-shot? I see two folders and two solution files. One folder is for the web project and the other is for the Silverlight project.

Are you getting something different. If that is the case could you please provide a screen-shot.

Thanks in advance.

All the best,
Ross
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Alessandro
Top achievements
Rank 1
answered on 03 Mar 2011, 03:41 PM
Ross, you are right. There was another solution file that didn't include the project. Can you explain the offset values? Is the value of 30 arbitrary? How does one choose a value suitable for the application other than trial and error?
 -- xavier
0
Ivan Ivanov
Telerik team
answered on 07 Mar 2011, 01:40 PM
Hello Xavier,

Yes, it is an arbitrary value. You may calculate one that fits your case best, by using the measurement values of your RadGridView. For example you can  obtain GridViewRow's height in this way:
Copy Code
var Offset = (App.Current.RootVisual as MainPage).ChildrenOfType<GridViewRow>().Where(s => s.Item != null).First().ActualHeight;



Regards,
Ivan Ivanov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
GridView
Asked by
Alessandro
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Alessandro
Top achievements
Rank 1
Rossen Hristov
Telerik team
Share this question
or