Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Display information from combo box inside a grid
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00061060
Message ID:
00061085
Vues:
34
>I have a question on creating a grid with a combo box inside. My problem
>is as follows (simplified version).
>
>I have 3 tables - A, B, and C. A is the parent table with a unique id and
>customer_name. B is the child table with two fields, unique_id and
>product_code. C is a dictionary with two fields, product_code and
>product_description. A and B have a one-to-many relation.
>
>I created a form that shows customer_name from A. I also created a "one-
>column-grid" with a combo box as the control with B as the child. When
>users click on the combo box, product_name and product_id (from table C)
>will be shown. Once the users choose the product, the assoicated
>product_code will bound to table B.
>
>My problem is that since B is the child and B only has product_id but not
>product_name, I can only get the product_code shown on the grid, but not the
>product_name. Product_name only pops up when I click on the combo box.
>After I select the product, the only thing shows on the grid is product_code.
>Do anyone know how I can get the product_name shown on the grid instead of
>the product_code?
>
>Thanks in advance.
>
>
>Chu

Chu, there are 2 ways to handle this.

1. Populate your grid with a View instead of a cursor. The view has Product_name as one of its fields.

2. Set a relation between tables B and C. Then in the grid set the column controlsource to C.product_name. Although you can't do this in the builder, it is perfectly OK to use a field from a related table in a grid column.

HTH
Barbara
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform