2X faster development
The ultimate WPF UI toolkit to boost your development speed.
By default, it is not possible to scroll one SfDataGrid through another. However, it can be achieved by using the ScrollChanged event of the SfDataGrid. You can wire the ScrollChanged event in the loaded event of the Datagrid1 like the following code example. XAML
C#
As given in the above code example, you can set the Horizontal or Vertical offset based on its corresponding Horizontal or Vertical change while scrolling. Likewise, you can wire the ScrollChanged event for Datagrid2 and set the Horizontal and Vertical offset.
Sample Links:
|
2X faster development
The ultimate WPF UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.
Is there a similar example without referring to the grids in the code behind i.e. MVVM?
Hi Zeljko,
We have analyzed your query to synchronize the scrolling between two SfDataGrid in MVVM pattern. And you can achieve this requirement by writing behavior for each datagrid as like below code snippet,
C#:
Please find sample for the same from the below link Sample Link: WPF
Please let us know, if you need any further assistance on this.
Regards, Shobika.
Hi,
Same problem, I tried with the behavior version but on AssociatedObject_Loaded, this.AssociatedObject.GetVisualContainer() return null… I've also set ScrollViewer.HorizontalScrollBarVisibility="Visible" in xaml in case of… but… Regards.
Hi Thierry,
Thanks for your update.
We have checked the reported case in our sample. But unfortunately we are unable to reproduce the reported issue in our end. Please ensure whether you have any other customization in your sample and let us know if any. It will be helpful for us to find the cause for the issue and provide a proper solution.
Regards, Mohanram A.