Page 2 of 2

Re: All grid values to md array

Posted: Wed Feb 09, 2022 1:43 am
by Claudio Ricardo
Thank you very much Jimmy, Salinetas and Franco !!! I'll try your solutions tomorrow.
Muchas gracias Jimmy, Salinetas y Franco !!! Mañana pruebo sus soluciones.

Jimmy, since almost always the data to load in the grid comes from SQL and has a fixed number of columns, I use:

Code: Select all

	DoMethod ("Cortes" , "Grid_1" , "DeleteAllItems")

	If HMG_Len ( aTable ) > 0
		For i := 1 To HMG_Len ( aTable )
			DoMethod ("Cortes" , "Grid_1" , "AddItem" , aTable [i])
		Next
	EndIf
You say that if I use " ITEMS aData " directly instead of my usual routine (shown above) when I edit a cell it will be reflected in the array ?
That would be exactly what I'm needing !!!

Re: All grid values to md array

Posted: Wed Feb 09, 2022 12:23 pm
by AUGE_OHR
hi Claudio,

i do use much "virtual" GRID and "know" that i can change

Code: Select all

   ITEMS aData 
"on-fly" e.g. when change Folder and Display it

but i have not try

Code: Select all

   ALLOWEDIT .T.
to "Edit" new Data this Way (which is HMG Way)
i do "Prompt" each FIELD in a loop to "Edit"

as i say it is need to send

Code: Select all

   SetProperty( "Main", "Grid_1", "ITEMCOUNT", LEN( aData ) )
else you got a "bound Access fail"

---

to use "AddItem" is the "safe" Way
when have a lot of Items i can be need a long Time to "AddItem"

but a SQL Result-Set "is" a Array like Directory() so you "direct" can assign it to GRID

Re: All grid values to md array

Posted: Wed Feb 09, 2022 10:28 pm
by Claudio Ricardo
Muchisimas gracias a Jimmy, Salinetas, Andy y Franco, gracias a ustedes logré lo que estaba necesitando
y además aprendi varias cosas más sobre el control grid !!! Paso el dummy limpio y funcionando.
Ahora lo puedo incorporar al programa real y ver los reultados con valores reales.

Many thanks to Jimmy, Salinetas, Andy and Franco, thanks to you I got what I needed
and I also learned several more things about the grid control !!! I pass the dummy clean and working.
Now I can incorporate it into the real program and see the results with real values.