Save grid array

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

Post Reply
chrisjx2002
Posts: 190
Joined: Wed Jan 06, 2010 5:39 pm

Save grid array

Post 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.
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Save grid array

Post 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
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Save grid array

Post 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.
Andrés González López
Desde Guadalajara, Jalisco. México.
chrisjx2002
Posts: 190
Joined: Wed Jan 06, 2010 5:39 pm

Re: Save grid array

Post by chrisjx2002 »

Thanks Claudio for the tip. It works. I think it would be nice to have the save option for array too.
Post Reply