Actualizar los datos del un virtual GRID

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
mjaviergutierrez
Posts: 146
Joined: Fri Nov 30, 2012 7:51 pm
Location: San Lorenzo, Santa Fe, Argentina

Actualizar los datos del un virtual GRID

Post by mjaviergutierrez »

hola, como actualizo los datos de un virtual grid ?
...
User avatar
AUGE_OHR
Posts: 2064
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Actualizar los datos del un virtual GRID

Post by AUGE_OHR »

hi,
mjaviergutierrez wrote: Wed Sep 30, 2020 12:44 am hola, como actualizo los datos de un virtual grid ?
after update Array call this

Code: Select all

PROCEDURE RefreshCurrent( cForm, cBrowse )
LOCAL hBrowse := GetControlHandle( cBrowse, cForm )
LOCAL nRecord := GetProperty( cForm, cBrowse, "VALUE" )
   ListView_RedrawItems( hBrowse, nRecord, nRecord )
RETURN
have fun
Jimmy
User avatar
mjaviergutierrez
Posts: 146
Joined: Fri Nov 30, 2012 7:51 pm
Location: San Lorenzo, Santa Fe, Argentina

Re: Actualizar los datos del un virtual GRID

Post by mjaviergutierrez »

Gracias amigo AUGE_OHR, saludos.
...
User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

Re: Actualizar los datos del un virtual GRID

Post by SALINETAS24 »

Y ya que estamos...,
¿en que se diferencia un GRID NORMAL cargado con un array, imaginemos de 1000 elementos y de un GRID VIRTUAL, que también carga un array de 1000 elementos?
Quedo agradecido de antemano por la aclaración....
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
User avatar
AUGE_OHR
Posts: 2064
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Actualizar los datos del un virtual GRID

Post by AUGE_OHR »

hi,

normal you have to load each Element using AddItem() ... this can take some Time :roll:

when already have a Array e.g. Directory() you need this

Code: Select all

   aDir := Directory()
   ...
   ITEMCOUNT LEN( aDir )
   VIRTUAL .T.
   ON QUERYDATA OnDataRequestStruct( aDir )
you do not have to use AddItem while Data are read "on-fly" when QUERYDATA Event ( LVN_GETDISPINFO ) is fired

Code: Select all

FUNCTION OnDataRequestStruct( aData )
LOCAL xVal
LOCAL nRow := This.QueryRowIndex
LOCAL nCol := This.Querycolindex
   IF .NOT. EMPTY( nRow ) .AND. nRow <= LEN( aData )
      xVal := aData[ nRow ] [ nCol ]
      This.QueryData := xVal
   ENDIF
RETURN .T.
FUNCTION OnData is like "DbSkipper" in TBrowse but much faster to display Data in GRID.
have fun
Jimmy
Post Reply