Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VERY frustrated with Grid behavior. This should work.
Message
De
23/03/1998 02:42:27
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
VERY frustrated with Grid behavior. This should work.
Divers
Thread ID:
00086298
Message ID:
00086298
Vues:
53
Hi,

I have a form in VFP5a that has a grid on it, which has 3 columns and in the 3rd column there is a checkbox. The first works great when it is first instantiated. However I have a pulldown box that allows the user the choose a different table to populate the grid with. When they change tables for some reason, the grid gets all messed up, even though it's the exact same method that is being called when the form is first instantiated as when the user changes tables. When I say the grid gets messed up, I mean the columns go from 3 to 4 (which incidentally is how many columns there are in the resulting query, even though I only want to show 3 in the grid), the headings change from the headings I set at design time to the names of the result columns from the Select SQL statement, and the check box disappears and in it's place the logical field is shown with .F. in each field. WEIRD!!
Any ideas???


The following is the method code:

if used("cust") && the table to select from into a cursor (make sure it is not being used)
sele cust
use
endif

if used("temp") && the updateable cursors alias
sele temp
use
endif

IF FILE(alltrim(gcUSADTDIR) + alltrim(files.path_name) + "cust.dbf")
sele 0
use (alltrim(gcUSADTDIR) + alltrim(files.path_name) + "cust") alias cust
sele name, addr1, .f. AS bSelected, cust_no from cust nofilter order by name into cursor tempcur
use dbf("tempcur") in 0 again alias temp
use in tempcur
sele temp
with thisform.cnt2.custgrid
.recordsource = "temp"
.column1.controlsource="temp.Name"
.column2.controlsource="temp.addr1"
.column3.controlsource="temp.bSelected"
endwith
thisform.cnt2.selectType.interactivechange()
endif
THISFORM.REFRESH()
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform