Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid and Requerying
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00302205
Message ID:
00302360
Vues:
24
Hi Gerard.

>>If I call my SetColumns methos after point 4 above, I just get the first record from the
result set displayed in EVERY row, but again with the incorrect columns.

I've spent weeks trying to sort this out and would reaaly appreciate any help <<

The best solution is to set the recordSource of the grid up in the form load using CREATE CURSOR. Then you can add a custom ResetGrid method to your grid class and put code like this in it:
*** Zap the 'permanent' cursor
*** zapping doesn't close the grid's record source and cause 
*** the grid to have a nervous breakdown
WITH This
  SELECT ( .RecordSource )
  ZAP
  
  *** SELECT into a temporary cursor
  SELECT Client.Cl_Code, Client.Cl_Name, NVL(BusType.BusDesc,'') AS BusDesc, '' AS Country, Client.Cl_key, Client.Bus_Key FROM ;
	       Client LEFT JOIN BusType ON Client.Bus_Key = BusType.Bus_Key ;
	       ORDER BY Client.Cl_Code INTO Cursor Temp NOFILTER
  *** See if we have any records in the cursor
  IF _TALLY > 0 
    *** Append from temporary cursor if it has records
    SELECT ( .RecordSource )
    APPEND FROM DBF( 'Temp' )
  ENDIF      
  USE IN Temp
ENDWITH
HTH

Marcia
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform