Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Displaying value other than controlsource in grid
Message
From
08/02/1999 16:10:03
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00185208
Message ID:
00185264
Views:
17
>>>>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.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform