Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating grid data source.
Message
 
 
To
03/03/2003 20:45:52
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00760666
Message ID:
00760725
Views:
14
>>>>I need to close and reopen the data source (a cursor) for a grid without adversely affecting the grid.
>>>
Thisform.grid1.RecordSource = SPACE(0)
>>>* Create/recreate cursor
>>>...
>>>Thisform.grid1.RecordSource = "mycursor"
>>>Thanks for the quick response.
>>>
>>>When the cursor is refreshed, the grid is now showing all columns instead
>>>of a subset.
>>
>>You've to set recordsource of the grid to the empty string before you do anything to a cursor.
>
>This is what I am doing, here is the code:
cCurrentRecordSource = This.Parent.Parent.pagDetails.grdOrDetails.RecordSource
>This.Parent.Parent.pagDetails.grdOrDetails.RecordSource = SPACE(0)
>
>SELECT * ;
>	FROM OrDetail ;
>	INTO CURSOR curCurrentOrder ;
>	WHERE OrDetail.cOrder = cValue ;
>		AND ALLTRIM(OrDetail.cOrder) IN (Select Drawings.cOrderID FROM Drawings) ;
>	READWRITE
>
>This.Parent.Parent.pagDetails.grdOrDetails.RecordSource = cCurrentRecordSource
See Grid reconstruction and how to avoid it FAQ #8019.
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform