Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
240
Sync Scrolling
posted

Hay,

Is there any event of xamDataGrid (WPF 2008 vol 1\2) to get the value when the scroll position is changed?

i want to sync two grids when each one of them is scrolling.

tx

Parents
No Data
Reply
  • 69686
    posted

    Hello,

    Yes, there is a way. You have to handle the scrolling event in one of the grids and there call the  ScrollToVerticalOffset method with the new value of the process of scrolling from the ScrollEventArgs. Something like this:

    ... 

    <igDP:XamDataGrid x:Name="XamDataGrid1" ScrollBar.Scroll="XamDataGrid1_Scroll"/>

    <igDP:XamDataGrid  Name="xamDataGrid2"/>

    ... 

    private void XamDataGrid1_Scroll(object sender, System.Windows.Controls.Primitives.ScrollEventArgs e)
            {
                xamDataGrid2.ScrollInfo.ScrollOwner.ScrollToVerticalOffset(e.NewValue);
            }

Children
No Data