Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Re-binding RecordSource to grid, and ControlSources to C
Message
From
25/03/2004 10:50:08
 
 
To
25/03/2004 07:04:49
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00889474
Message ID:
00889624
Views:
21
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
Previous
Reply
Map
View

Click here to load this message in the networking platform