Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid goes empty
Message
From
17/02/1999 12:26:03
James Beerbower
James Beerbower Enterprises
Hochheim Am Main, Germany
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00188017
Message ID:
00188471
Views:
21
>>I am using the FFC Framework to develop an application.
>
>>In one form I am showing a grid with scheduling information for a particular day, which is based on a cursor. When I want to show the schedule for a different day, I ZAP the cursor, and then append the new records into that cursor. Then grid.setfocus() and grid.refresh()
>
>>But SOMETIMES the grid shows up empty after this procedure, even if the cursor contains records. When I click with the mouse anywhere in that grid, the data "magically" appears.
>
>>Of, course, I want to get rid of that "magic" and show the data all the time.
>
>>Does anyone have any clues as to this behaviour?
>
>I have not used a grid with a cursor recordsource (Do cursors need to be requeried?), but i have used several tables as grid recordsource. The recordsource does not like to be "messed with". zapping, closing, changing the value, etc are all messing with the recordsource. To see if the zap is the problem:
>
>hold_recordsource = grid1.recordsource
>grid1.recordsource = space(0)
>zap cursor1
>grid1.recordsource = hold_recordsource
>
>If this keeps your grid from blanking then the zap is the problem. Before the Zap you will need to save the recordsource, and possibly the columncount and columns' controlsource. After the zap restore your saved values.
>
>Brenda

The trick is to set the recordsource = '' before rebuilding (closing) the cursor used for the recordsource. Having done anything within ZAP myself.
m.lcRecordSource = THIS.grd.RecordSource
THIS.grd.RecordSource = ''
THIS.MyEvilFunctionThatRebuildsCursor()
THIS.grd.RecordSource = m.lcRecordSource

Jamie Beerbower
James Beerbower
James Beerbower Enterprises
Frankfurt, Deutschland
Previous
Reply
Map
View

Click here to load this message in the networking platform