Information générale
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
VERY frustrated with Grid behavior. This should work.
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement