Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox and phantom record
Message
De
14/06/2007 16:07:04
 
 
À
14/06/2007 15:52:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Network:
Windows XP
Divers
Thread ID:
01233240
Message ID:
01233266
Vues:
8
>>>>>>I have a combobox on grid with
>>>>>>
>>>>>>Column.Sparse = .f.
>>>>>>BoundColumn = 1
>>>>>>BoundTo = .f.
>>>>>>RowSourceType = Array
>>>>>>
>>>>>>Depending on value of another column of the grid the array of the combobox is loaded with different SQL, but always appear a phanton record (blank record) in the combobox.
>>>>>>
>>>>>>What am I doing wrong?
>>>>>
>>>>>Do you mean that combo.rowsource should be different for each record?
>>>>
>>>>The combo.rowsource is always with same name of the array.
>>>>
>>>>The contents of the array can be different for each record of the grid.
>>>>
>>>>This phanton record disappears after I choose one vale on combobox.
>>>
>>>In general, you cannot have different array contents for every record. How many records you have?
>>
>>The array has 20 records in the maximum on each case (3 differents). The grid is empty I am inserting records on it.
>
>If I understand you correctly you may have 3 different rowsources. In this case you may add 3 comboboxes (with fixed source) to the column and use DynamicCurrentControl property to show correct box for every record.

This is the code of lostfocus of column1

&& vwcargacond is a view and is the recordsource of the grid

m.idtipo = vwcargacond.idtipo && vwcargacond.idtipo is the controlsource of combo of column1
IF vwcargacond.idtipo <= 2
SELECT motor.dspotencia ;
FROM motor ;
WHERE motor.idtipo = m.idtipo ;
INTO ARRAY Thisform.arrtipocarga ;
ORDER BY 1
ELSE
SELECT tipocarga.dstipocarga ;
FROM tipocarga ;
INTO ARRAY Thisform.arrtipocarga ;
ORDER BY 1
ENDIF
Thisform.pageframe1.page3.ackgrid.column2.cbodstipocarga.Requery()

&& Thisform.arrtipocarga is the rowsource of the cbodstipocarga
Antonio Carlos Kleinübing
Systems Analyst
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform