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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

move the same row of two different grids with click and scroll vpf6

Status
Not open for further replies.

fanlinux90

Programmer
Oct 31, 2022
22
0
0
CO
I can move the same row of two different grids that use the same cursor as recordsource after clicking on any column of the grid pc and using the keyboard

grid pc1 procedure afterrowcolchange

LOCAL lcAlias
lcAlias = ALIAS()

SELECT(this.recordsource)
SKIP
IF EOF()
GO BOTTOM
ENDIF

IF NOT EMPTY( lcAlias )
SELECT( lcAlias )
ELSE
SELECT 0
ENDIF

thisform.pc.setfocus()

grid pc procedure afterrowcolchange

LOCAL lcAlias
lcAlias = ALIAS()

SELECT(this.recordsource)
SKIP
IF EOF()
GO BOTTOM
ENDIF

IF NOT EMPTY( lcAlias )
SELECT( lcAlias )
ELSE
SELECT 0
ENDIF

Thisform.pc1.Columns(1).SetFocus()
thisform.pc1.setfocus()

How do I move the same row of two different grids when I use the mouse, when I click on it the same row is selected and when I use the scroll the two grids are moved?
 
Take a look at the Scrolled() event and the DoScroll() method. Basically you would call DoScroll() for the opposite grid in the grid that is being scrolled via the Scrolled() event. In the event AfterRowColChange() for both grids, move the record pointer for the other grid and then do a OtherGrid.Refresh().

Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top