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

[Solved] scroll event and scrolling programmatically

2 Answers 420 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.
Anne Lyon
Top achievements
Rank 1
Anne Lyon asked on 26 Oct 2010, 12:17 PM
Hi,

I have a simple question I hoped you could answer:
I have 2 grids that are bound to 2 different ItemSources but each row shows information about the same "entity". What I would like to achieve is that when I scroll in one grid, the other grid will scroll the same way automatically so that the viewports in the two grids always show the same rows/entities. If top row in one grid shows data for "item X", then the top row in the other grid should also be "item X". But I don't seem to be able to get this "synchronized" scrolling to work. First of all I can't find an event that is raised when user scrolls a grid, and second I can't find a method that sets the top row in the viewport as the same top row in the other grid's viewport. (I have done the same functionality before in another application using Farpoint Spread as the grid). Any suggestions?

2 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 26 Oct 2010, 01:44 PM
Hi Anne Lyon,

You can get a reference to the internal ScrollViewer with a code like :

GridViewScrollViewer scrollViewer = RadGridView1.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault();
for this to work , you will need :
using Telerik.Windows.Controls
and
using System.Linq

Having a reference to the ScrollViewer , you may try subscribe to its ScrollChanged event.
This will allow you to detect when the user scrolls.
Getting a reference to the ScrollViewer of the second grid , the same way , would allow you to set the vertical scroll position respectively.

In case you have troubles implementing this, just let me know.




Sincerely yours,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Roger
Top achievements
Rank 1
answered on 24 Mar 2013, 04:55 PM
can you help me to attach a scroll event to radListView i can't find how 
Tags
GridView
Asked by
Anne Lyon
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Roger
Top achievements
Rank 1
Share this question
or