LPARAMETERS nColIndex LOCAL lcCatCode, lnFacCatCode, lcAlias, lcFilter, lnRecNo Select pxCOMPLETE && Source of the grid in question lnRecNo = RECNO() && THIS always returns that of record top of grid and not newly selected row lcCatCode = pxCOMPLETE.CATCODE * If the parent completion record of a classn. has an mPlan Fac. Cat. Code assigned to it then filter the * available Fac. Desc. records, for the combo, to only those that belong to the assigned fac. cat. code (or * those that belong to none - i.e. not got a cat yet. * Otherwise un-filter Fac Desc table (in case it was filtered) * NOTE this goes in a selection combo in one of the grid cells of the child table * ____________________________________________________ lnFacCatCode = pxComplete.FacCatCode Select FACDESC If EMPTY( lnFacCatCode) Set Filter To Else lcFilter = "FAC_CAT_CODE = " + ALLTRIM( STR( lnFacCatCode)) + ; " OR EMPTY( FAC_CAT_CODE)" Set Filter To &lcFilter Endif Locate Thisform.grdClassn.Refresh() && This grid's child grid Select pxCOMPLETE Replace all PXCOMPLETE.lSELECTED with .F. && used to mark current rec with dynamicbackcolor GOTO lnRecNo && SHOULD be currently selected row but goes to top Replace PXCOMPLETE.lSELECTED with .T. && used to mark current rec with dynamicbackcolor Thisform.lEntryCodes = .F. Thisform.Refresh() Thisform.LockScreen = .F.and thisform.Refresh():
With thisform If .lEntryCodes .grdEntryCodes.Column2.DynamicBackColor = "IIF( PXENTRYCODES.lSELECTED = .F., ; RGB( 255, 255, 255), RGB( 255,128,128))" Else .grdCompletion.Column2.DynamicBackColor = "IIF( PXCOMPLETE.lSELECTED = .F., ; RGB( 255, 255, 255), RGB( 255,128,128))" Endif EndwithThe bizarre thing is that the correctly clicked on row gets highlighted with the DynamicBackColor but the cursor shoots back up to the 1st rec in the grid. Debug always shows the 1st rec as selected, and the datasession window corroborates.