Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9161433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:57:57+00:00 2026-06-17T13:57:57+00:00

I have to access to ScrollViewer in GridControl to do a synchronization with my

  • 0

I have to access to ScrollViewer in GridControl to do a synchronization with my other GridControls on scrolling.

Before I used vanilla DataGrid and it was quite easy to get ScrollViewer via VisualTreeHelper and then to subscribe to the ScrollChanged events.

I tried the same approach with GridControl but no luck. VisualTreeHelper.GetChildrenCount() gives me 0 and also LogicalTreeHelper.GetChildren() gives me an empty iterator.

But..

WPF Snooper can access logical and visual trees just perfectly perfect!
So, what I’ve done wrong and why I am not able to get the information WPF Snooper is able to get?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:57:58+00:00Added an answer on June 17, 2026 at 1:57 pm

    That was the case! I tried to initialize it too early.

    I did it in constructor, when it was initialized yet.

    If someone needs solution how to synchronize data grids (it doesn’t matter if this is vanilla DataGrid or DevExpress GridControl or mix of them) to show the same data when you are horizontally scrolling and you have more columns then you can show then here is the solution:

    In your constructor:

        mainDataGrid.Loaded += (sender, args) =>
                               {
                                   ScrollViewer sv = mainDataGrid.FindVisualTreeChild<ScrollViewer>();
    
                                   if (sv != null)
                                       sv.ScrollChanged += DataGridScrollChanged;
    
                               };
    

    Add the event handler for ScrollChanged event:

    private void DataGridScrollChanged(object sender, ScrollChangedEventArgs e)
    {
        if (e.HorizontalChange == 0.0f)
            return;
        ScrollViewer sv = dependentDataGrid1.FindVisualTreeChild<ScrollViewer>();
        if (sv != null)
            sv.ScrollToHorizontalOffset(e.HorizontalOffset);
    
        sv = dependentDataGrid2.FindVisualTreeChild<ScrollViewer>();
        if (sv != null)
            sv.ScrollToHorizontalOffset(e.HorizontalOffset);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have access to command line isql and I like to get Meta-Data of
I have access to a virtual machine via vmware client and want to do
I have access to a joomla edition but not the source, and I need
I have Access 2003, and Crystal Reports 10 (the one that comes with VS2008
I have access to a 3rd party PropertyGrid within my application (C#. ,Net v2).
I have Access table with fields, in which there is some data and path
In my app i have access to web server. It works fine in Some
Many threads have access to summary . Each thread will have an unique key
I have application with needs to have access to some sensitive data(in this case
Assume I have access to a SMB server at IP 1.2.3.4, how can I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.