Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating grid data source.
Message
De
03/03/2003 20:56:59
 
 
À
03/03/2003 20:45:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00760666
Message ID:
00760696
Vues:
11
>>>>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 from a text box VALID() that contains a new Order ID:
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
I've just discovered why the columns were being reset: The cursor was being created in the init event.

Now the column headings are correct, but the actual data displayed does not correspond to the headings.

More details:
I've discovered that the columns are displayed correctly if I view the Grid immediately. However when I set the ...grdOrDetails.RecordSource = Space(0) each column loses it's ControlSource.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform