Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP6SP5 - Unselect Combo selection
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00795134
Message ID:
00796581
Vues:
89
Sorry to trouble you again. This cbo you had suggested works well. This cbo I have in a grid. As soon as I exit the cbo in the grid the Display from the description of the item changes to the iID of the item.

You have 2 options:

Set the sparse property of the column to false.

If the combo box is style 2-drop down list, you can set up the controlSource as something like this:

(IIF( SEEK( MyRecoursSource.MyKeyField, 'MyLookupTable', 'MyLookupIndex' ), MyLookupTable.Description, '' ) )

The reason this only works with a dropdown list is because setting up the column's ControlSource like this has the effect of making the column ReadOnly. However, ReadOnly only applies to the portion of a control that accepts text. Since a drop down list does not accept text, it cannot be made ReadOnly, so when it has focus you can still change the data.

If you must use a combo of style=0-drop down combo in the grid, hopefully you have subscribed to FoxPro Advisor. I had an article about a combo box in a grid class that handles this problem in the Febraury 2000 issue of the magazine called "Spice up Your Grid with a Combo". Here is the abstract:

Combo boxes provide a very intuitive way for users to choose from a fixed list, but making them work in grids is tricky. Here's a cookbook approach so that you can make combos and grids cooperate once and for all.

Unfortunately, I cannot post all the code required to make that class work because there is way too much of it.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform