Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DynamicCurrentControl
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00304937
Message ID:
00305029
Vues:
31
>To All,
>
>A grid with a RowSource type Alias, the table is 'RELATED', the field 'b_entity', which may be a foreign key into either the 'PARTNER' or 'BUSINESS' tables
>
>I placed two textboxes in the first column, txtPartnerName, bound to PARTNER.last_name, and txtBusinessName bound to BUSINESS.busn_name, and deleted the defualt txtbox. In the column1.DynamicCurrentControl I placed this line
>
>=IIF(INDEXSEEK('RELATED.b_entity', 'PARTNER'), 'txtPartnerName', 'txtBusinessName')
>
>Sparse is .F.
>
>The rest of the grid displays other information from RELATED.
>
>My intention was to display either the person's name or the business name in the first column, along with the 'related' information.
>
>The APPLICATION table is the a_entity keyed into RELATION. My test data had the application related to four applicants, person, business, person, person. It worked the first time with the person names showing, but no entry in the second slot for business. I looked in the business table and discovered that I had forgotten to enter a value. I did so. I tinkered around a bit with the grid, for no good reason, and when I ran it again it was broken! Now the first column is blank, although I still see the rest of the columns. Can anyone tell me what I might have done??
>
>Thanks, Al Allison

I do not think that you take safe way. You may do it differently, adding this line to grid.init event
This.ColEntity.Controlsource="''+Thisform.ShowEntity(RELATED.b_entity)"

'ShowEntity' is form custom method:
LPARAMETER lEntity
IF lEntity=.t.
Return Partner.Name
ELSE
Return Business.Name
ENDIF
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform