Page 1 of 1
Save grid array
Posted: Tue Mar 10, 2015 6:01 pm
by chrisjx2002
Hi Everybody,
I try to use grid instead of browse. I have a simple problem : the save function does not seem to work when using an array as ITEMS.
I define a Grid_1 in a Form_1 with an array aTest as ITEMS. I use EDIT to modify the values. It works on the screen. But when I try to save the new values with the save option : Form_1.Grid_1.save it does not modified the array aTest. I miss certainly something but I don't know what. Any help will be appeciated.
Re: Save grid array
Posted: Tue Mar 10, 2015 6:20 pm
by srvet_claudio
chrisjx2002 wrote:Hi Everybody,
I try to use grid instead of browse. I have a simple problem : the save function does not seem to work when using an array as ITEMS.
I define a Grid_1 in a Form_1 with an array aTest as ITEMS. I use EDIT to modify the values. It works on the screen. But when I try to save the new values with the save option : Form_1.Grid_1.save it does not modified the array aTest. I miss certainly something but I don't know what. Any help will be appeciated.
EDIT option only work with database
Code: Select all
aData := Array (Form_1.Grid_1.ItemCount, Form_1.Grid_1.ColumnCount)
For i:= 1 TO Form_1.Grid_1.ItemCount
For j:= 1 TO Form_1.Grid_1.ColumnCount
aData [i,j] := Form_1.Grid_1.Cell (i,j)
Next
Next
Re: Save grid array
Posted: Tue Mar 10, 2015 6:30 pm
by andyglezl
Hola chrisjx2002
...It works on the screen...
Por lo tanto solo tienes que tomar el renglon modificado:
MSGDEBUG( Form_1.Grid_1.Item( Form_1.Grid_1.Value ) )
El array aTest es solo para iniciar el GRID con Informacion.
--------------------------------------------------------------------------
Hello chrisjx2002
...It works on the screen ...
So you just have to take the changed row:
MSGDEBUG( Form_1.Grid_1.Item( Form_1.Grid_1.Value ) )
The aTest array is just to start the GRID with information.
Re: Save grid array
Posted: Tue Mar 10, 2015 7:17 pm
by chrisjx2002
Thanks Claudio for the tip. It works. I think it would be nice to have the save option for array too.