Recommended:
- Code: Select all Expand view RUN
REDEFINE XBROWSE oBrw Id 10 ;
OF oDlg_Articulos ;
DATASOURCE oArticulos ;
COLUMNS "Descripcion" ; //FIELDS oArticulos:descripcion HEADERS "Descripcion" ;
FIELDSIZES 350 ; // JUSTIFY AL_LEFT
FONT oFontData ;
CELL LINES ;
FASTEDIT // optional
WITH object oBrw
// :l2007 := .t.
// :lRecordSelector := .t.
WITH OBJECT :aCols[ 1 ]
:nHeadStrAlign := AL_CENTER
:oHeaderFont := oFontHeader
:nEditType := EDIT_GET //
END
END
oArticulos:Gotop()
// oBrw:Refresh() // remove this line
ACTIVATE DIALOG oDlg_Atriculos
1) Do not use FIELDS clause. Use COLUMNS clause. In the COLUMNS clause, provide the names of the fields as strings.
2) Do not use bStrData and bOnPostEdit. Their usage was deprecated many years ago.
Quiero poder Editar y Cambiar el Valor de cualquier celda de esa columna,
¿Que debo Hacer?
English:
I want to be able to Edit and Change the Value of any cell in that column, What should I do?
This is enough.
- Code: Select all Expand view RUN
oBrw:aCols[ 1 ]:nEditType := EDIT_GET
This is the line that enables editing the value in the cell and save it to the table.
User can directly type into the cells and make changes.
¿ese cambio afecta la tabla directamente o actua sobre el arreglo resultado de la consulta?
ENGLISH
Does this change affect the table directly or does it act on the array resulting from the query?
All changes are saved immediately to the table on the Server.
I undertanad oArticulos as TDolphin Query.
Spanish
Necesito que NO afecte la tabla directamente.
ENGLISH
I need it to NOT affect the table directly.
If you are using TDolphin, read the data into an array and then Browse the array like this.
- Code: Select all Expand view RUN
REDEFINE XBROWSE oBrw Id 10 ;
OF oDlg_Articulos ;
DATASOURCE aArray ;
COLUMNS 1 ;
HEADERS "Descripcion" ;
<...other clauses...>
If you are using FWH built-in library, this is not necessary.
Simply set
- Code: Select all Expand view RUN
oArticulos:SetBatchMode( .t. )
All changes made are retained in the memory only and are not written to the real table.
Later, if you want to save all the changes to the server at once, then call oArticulos:SaveBatch() and otherwise simply ignore the changes.