View previous topic :: View next topic |
Author |
Message |
billcch
Joined: 19 Jan 2007 Posts: 44
|
Posted: Thu Dec 03, 2009 7:35 pm Post subject: How to control scroll bars |
|
|
I have two virtual trees, both contains the same nodes, and I need to keep scroll bars synchronize, for instance, TopRowIndex changed in the tree1 should trigger the tree2 change the TopRowIndex to the same number; and if user move the HorzScrollBar in one tree, another tree should have the same movement. Could you help me to make it happen?
I am using 3.13.0.0.
Thanks |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Dec 03, 2009 9:38 pm Post subject: |
|
|
Unless the state of the two trees is completely the synchronised - ie they are displaying the same data, expanded in the same way with the same columns - then this is going to be quite difficult since the position of the scroll bars depends on how much of the tree is expanded etc. If the data is that similar I'm not sure what the point of having two trees would be - why not just add more columns to one tree?
When trees are displaying related data it is possible to handle the SelectionChanged event in one tree, then find the corresponding Row in the other tree and select it. _________________ Infralution Support |
|
Back to top |
|
|
billcch
Joined: 19 Jan 2007 Posts: 44
|
Posted: Fri Dec 04, 2009 12:40 am Post subject: |
|
|
There are displaying similar data (not exactly the same), but the hierarchy are the same. I have done synchronise both selection change and node expanding. Use two trees are the request from our customer, the scroll bar behavior needs to be similar like the sofeware named Beyound Compare. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Dec 04, 2009 10:42 pm Post subject: |
|
|
If you derive a new class from VirtualTree then you can access the protected HorzScollBar and VertScrollBar properties that provide access to the underlying scroll controls for Virtual Tree. You could then attach events handlers and attempt to synchronize that way. _________________ Infralution Support |
|
Back to top |
|
|
|