Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to sync two girds ?

Status
Not open for further replies.

ipazzo

Programmer
Jan 17, 2002
69
IT
Hello,

does anyone knows how two sync two girds ?

I have a form with two girds that not fit horizontally on the form and i need to scoll left and right the second gird when the user scrolls the first. Using the DoScroll metod and Scrolled event works only if the user uses the scrollbar but not when the gird as the focus and the the scroll is done with arrow keys.

Any suggestion.
 
You're using the same RecordSource for both grids, right? In the AfterRowColChange method of the first grid, try setting focus to the second grid, then back to the first grid again. If you're using VFP 7 or 8, you can check if the RowColChange property is 1 or 3 first, so that you only setfocus when the row changes.



-BP
 
Thanks for the help, but not completely works.

The first gird is for detail and the second gird displays only one line with the total of the columns in the first one.
Note that the first gird is freezed at column 4.

eg.

gird1
art. cod. qt price i1 i2 ... i24
--------------------------------
100 100 1 121 2 3 ... 2
101 101 3 221 3 3 ... 4

gird2
--------------------------------
4 342 5 6 ... 6

in the second gird i use calculation as controlsource to display values.

The girds not syncronizes when i scroll from the right most column to the first column.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top