The Xbrowse objects has 5 columns from the array , when user enters value in the 3 Column/Cell It does NOT capture/display values in the Cell when oTBrow:SelectCol(5) method used in the bKeyDown Code Block.
But when oTBrow:SelectCol(5) Method is removed from the code block , the Edit Values are capturing but can not move the control to the 5th column.
Is this correct behaviour of the XBROWSE ? if it is correct then how we should skip 4th column and jump to 5th column ?
Please guide for the same. Thanks in advance...!
Given Below Code:
- Code: Select all Expand view RUN
function TestBrw
local oTBrow
local oDlg
local aTxnVou := {{"D" ,"Abc A/c ", 0 , 0 , Space(100) }}
DEFINE DIALOG oDlg FROM 0 , 0 TO 500 ,1050 PIXEL TRUEPIXEL STYLE nOr( DS_MODALFRAME , WS_POPUP )
@120, 020 XBROWSE oTBrow SIZE 1020, 350 PIXEL OF oDlg ;
DATASOURCE aTxnVou ;
COLUMNS {1, 2, 3, 4, 5 };
HEADERS {"D/C", "Account", "Debit", "Credit", "Narration" };
PICTURES {"!", NIL, "@Z 99,99,999.99", "@Z 99,99,999.99",NIL } ;
COLSIZES { 40, 350, 140, 140, 200 } ;
CELL LINES NOBORDER FASTEDIT FOOTERS
// Debit column
WITH OBJECT oTBrow:aCols[ 3 ]
:nEditType := EDIT_GET
:bKeyDown := < | nKey |
IF ( nKey == VK_RETURN )
// to Jump to the Narration Column
oTBrow:SelectCol(5)
ENDIF
>
END
WITH OBJECT oTBrow
:lEnterKey2Edit := .F.
:CreateFromCode()
END
ACTIVATE WINDOW oDlg
return nil