We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Synchronize two grid scrollbars

Thread ID:

Created:

Updated:

Platform:

Replies:

93446 Mar 15,2010 02:50 PM UTC Mar 19,2010 02:02 PM UTC WPF 6
loading
Tags: GridControl
Christian Louvel
Asked On March 15, 2010 02:50 PM UTC

Hello, we have two grids one top of another. We'd like to synchronize their scrollbars.

We've tried to put them in the same scrollviewer but that won't do, because the grids are too large and the vertical scrollbar won't show unless we go to the far right of the grid.

Is there a way to achieve that?

Thanks in advance.

Clay Burch [Syncfusion]
Replied On March 15, 2010 03:58 PM UTC

You did not say whether you are working with a GridControl or a GridDataControl. Also, are you trying to synchronize the vertical scrollbars or the horizontal scrollbars?

Here is a little sample that works to synchronize 2 GridControls both vertically and horizontally using the grid.HScrollBar.ValueChanged /grid.VScrollBar.ValuedChanged events. Depending upon your needs, you might remove some of the event handlers.






WpfApplication29_f33e1082.zip

Christian Louvel
Replied On March 15, 2010 06:05 PM UTC

Hello, we're using DataGridControls and we're trying to synchronize the vertical scrollbar, sorry for the lack of precision.

Your example shows what we'd like to do, but my developper says the VScrollBar and HScrollbar aren't usable in the DataGridControl.

We'll try to look further but we'd be thankful if you could provide some help.




Clay Burch [Syncfusion]
Replied On March 15, 2010 09:00 PM UTC

Here is the sample back showing one way to do something similar with GridDataControls. It hides the horizontal scrollbar on the top grid and scrolls both grids using the horizontal scrollbar on the bottom grid.



WpfApplication29_3b062ae3.zip

Clay Burch [Syncfusion]
Replied On March 16, 2010 08:28 AM UTC

Here is another version of that sample tweaked to synchronize the vertical scroll bars as well as the horizontal scrollbar.



WpfApplication29_40640c8b.zip

Christian Louvel
Replied On March 16, 2010 10:41 AM UTC

We were able to adapt this, it works fine.

Thanks a lot for your help.

Karthik Vishnu R [Syncfusion]
Replied On March 19, 2010 02:02 PM UTC

Thanks for the feedback. Let us know if you need more details.

Regards,
Karthik

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;