Page 1 of 1
Jump into edit mode
Posted: Wed Mar 09, 2022 6:20 pm
by Detlef
Dear all,
I have a dialog with a xBrowse with arrays datasource.
The array has only one single row.
How can I jump directly into edit mode of the first left cell when the dialog opens?
I tried the ON INIT clause when activating the dialog.
But oBrw:aCols[1]:SetFocus() does of course not work.
Anyone who give me a hint?
Re: Jump into edit mode
Posted: Wed Mar 09, 2022 9:59 pm
by FranciscoA
Algo asi?:
Code: Select all | Expand
//--------------------------------------------//
// BROWSE EN EDICION AL INICIAR EL DIALOG
//--------------------------------------------//
FUNCTION BrwEditIni()
local oCodi,cCodi:=" ", oCodi2,cCodi2:=" ", oDlg, oBrw, aData := {" "," "," "," "}
DEFINE DIALOG oDlg SIZE 540,200 PIXEL TITLE "BRW EN EDICION AL INICIO"
@ 4,10 GET oCodi Var cCodi SIZE 50,10 PIXEL OF oDlg PICTURE "@!"
@ 4,70 GET oCodi2 Var cCodi2 SIZE 50,10 PIXEL OF oDlg PICTURE "@!"
@ 20, 10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg DATASOURCE aData ;
COLUMNS 1,2,3,4 HEADERS "Col1", "Col2", "Col3", "Col4" FASTEDIT
WITH OBJECT oBrw
:nMarqueeStyle := MARQSTYLE_HIGHLCELL
:nEditTypes := { 1, 1, 1, 1 }
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( oBrw:SetFocus(), oBrw:nColSel := 1 )
Return nil
Re: Jump into edit mode
Posted: Thu Mar 10, 2022 8:24 am
by Detlef
Yes, it jumps to the first column.
But unfortunately it doesn’t get into edit mode.
Anyhow many thanks for your help, Francisco.
Re: Jump into edit mode
Posted: Thu Mar 10, 2022 10:23 pm
by nageswaragunupudi
Please try:
Code: Select all | Expand
ON INIT ( oBrw:SetFocus(), oBrw:nColSel := 1, oBrw:Edit() )
Re: Jump into edit mode
Posted: Fri Mar 11, 2022 8:21 am
by Detlef
Thanks, Mr. Rao.
Unfortunately my FWH version doesn't know the method ::Edit()
Re: Jump into edit mode
Posted: Fri Mar 11, 2022 9:34 am
by nageswaragunupudi
Sorry, my mistake.
Try this:
Code: Select all | Expand
ON INIT ( oBrw:SetFocus(), oBrw:nColSel := 1, oBrw:aCols[ 1 ]:Edit() )
Re: Jump into edit mode
Posted: Fri Mar 11, 2022 1:41 pm
by Detlef
This works fine.
Many thanks