How to find "PART_VerticalScrollBar" in scroll synchronization of two gridviews?

1 Answer 40 Views
GridView
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
Psyduck asked on 12 Jan 2022, 08:07 AM

hello.

I used the scroll synchronization function in two gridviews through the linked example.
https://www.telerik.com/forums/scrolling-two-grids-f949e02b84ab

Since this is an old version, the ShowSearchPanel property does not exist.

If I put a SearchPanel in "PART_VerticalScrollBar", two objects appear.

When SearchPanel=true, the first is the VerticalScrollBar of SearchPanel, and the second is the VerticalScrollBar of the GridView.

When SearchPanel=false, only VerticalScrollBar of GridView is displayed.

How can I identify the "PART_VerticalScrollBar" of the GridView when the user uses the SearchPanel as a variable? I guess you shouldn't use "LastOrDefault".

Thanks.

1 Answer, 1 is accepted

Sort by
1
Accepted
Martin Ivanov
Telerik team
answered on 14 Jan 2022, 02:12 PM

Hello KIM,

Indeed, the GridViewSearchPanel has its own ScrollViewer, thus the approach shown in the forum won't longer work as expected. To resolve this, you can use a slightly different approach. Instead of relying on the ScrollBar, you can get the GridViewScrollViewer controls and sync their HorizontalOffset and VerticalOffset values. I've attached an updated version of the project from the forum. I hope it helps.

Regards,
Martin Ivanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
GridView
Asked by
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
Answers by
Martin Ivanov
Telerik team
Share this question
or