Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Re-binding RecordSource to grid, and ControlSources to C
Message
De
25/03/2004 10:50:08
 
 
À
25/03/2004 07:04:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00889474
Message ID:
00889624
Vues:
22
Hello,

i've this little function's in my Grid base class .. so that i can easily overcome the grid reconstruction behaviour when they are based on a cursor
&& Grid Init:
&& save recordsource and controlsources
WITH THIS
 .AddProperty('cRecordSource',.RecordSource)
 FOR EACH oColumn IN .Columns
  oColumn.AddProperty('cOriginalControlSource',oColumn.ControlSource)  
 ENDFOR
ENDWITH

&& Grid Lock Method:
&& unbind grid
THIS.RecordSource = ''

&& Grid Unlock Method:
&& rebind grid ..
WITH THIS
 .RecordSource = .cRecordSource
 FOR EACH oColumn IN .Columns
  oColumn.ControlSource = oColumn.cOriginalControlSource
 ENDFOR
ENDWITH

the order of calls would be 

THISFORM.yourGrid.Lock()
&& mess around with the cursor .. recreate it ... destroy it .. or whatever .. and when finished .. and the cursor is available again ..
THISFORM.yourGrid.Unlock() && tell the grid to rebind ..
Regards

Christian
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform