Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get combo box to work the same on a grid?
Message
 
 
À
05/04/2001 07:57:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00492120
Message ID:
00492359
Vues:
19
>Hi Jeff.
>
>>>What I can't figure out how to do is to display the description in the grid c olumn once the selection has been made. All that I am able to display is the value of the control source which is the numeric foreign key. I am able to do this all day long using a combo box by itself on a form, but can't figure out how to make it do it with a combo box on a grid. <<
>
>As Vlad suggested, you can set the column's sparse property to false. Personally, I think this makes the grid look busy and cluttered. If your combo is a dropdown list (style = 2), you can leave the column's sparse property set to true and you can use this little trick:
>
>Set the controlsource of the column to something like this:
>
>IIF( SEEK( < Table.ForeignKeyField >, '< LookUpTable >', '< KeyField >' ), < LookUpTable.Description >, '' )
>
>Set the controlSource of your combo in the column to the Keyfield in your lookup table.
>
>Even though using the conditional expression for the column's ControlSource has the effect of making the column read only, you can still change the value in the drop down list. The reason for this is that ReadOnly applies only to the portion of a control that accepts text. Since a dropdown list does not accept text, you can still select a new value.
>
>HTH
>
>Marcia
Hi Marcia,

Very interesting trick, thanks.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform