Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Displaying value other than controlsource in grid
Message
De
08/02/1999 17:39:02
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00185208
Message ID:
00185316
Vues:
14
>>>>>>I think that sparse property should do this. Also, there is really another way to do this job:
>>>>>
>>>>>Sparse shows the boundcolumn, which is the surrogate key. I don't want to display the surrogate key.
>>>>>
>>>>>I want to change the key value, but display the discriptive value.
>>>>
>>>>Would you like to get right-click menu way? I don't mean that first way doesn't work. It does, but troubleshooting might be painful, espacially on-online (also I don't have VFP on-hand right now :).
>>>
>>>Give me the gist of the shortcut menu way? I am interested.
>>
>>It includes two parts:
>>1) Displaying field in grid from ahother table.
>>2) Getting this field 'edited' directly in grid.
>>Part 1.
>>Let say you have master and lookup table. One of master table field is foreign key (surrogate integer) from lookup table, e.g. "lookup_id". You set programmatically some
>>Grid.Column.Controlsource="''+getlookupdescription(mycursor.lookup_id)"
>>Here 'getlookupdescription' is system function (it can be also some object custom method, etc) which will return Lookup.description field:
>>Function GetLookupDescription
>>LParameter nId
>>IF SEEK(nId,"lookup","id")=.T.
>>RETURN Lookup.Description
>>ELSE
>>RETURN "Unknown"
>>ENDIF
>>
>>Try it, and if it's Ok, we can proceed to part 2.
>
>I didn't think to use a function to do the lookup in the controlsource. What will the value of the column be when you leave this column/record? If you return the LookupDescription, will that not be the value of the record, not the key. I will have to play with this.

Dean,
Column really has some value but it does not mean yet that data field must have the same value, i.e. column will really have the value returned by function, but the field will still keep surrogate key. Is it not what you wanted to achieve? And there is nothing to play here more.

>John's suggestion maybe the easiest to implement at this point. I am going to give it a try.

That's Ok.
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform