Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid control and dynamic lookup
Message
 
To
13/11/2007 13:17:54
Spencer Redfield
Managed Healthcare Northwest, Inc.
Portland, Oregon, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01267478
Message ID:
01268811
Views:
15
Hi Spencer,

Sorry, didn't see your earlier posting...been busy and it must have slipped past my radar.

Have you considered, while moving through the grid, firing a method on each row that populates a collection object with the desired items and keys for that row? That collection object would be bound to your ComboBox using RowSourceType = 10 to get its data directly from the collection, set to Style = 2 (Dropdown List) to make the control read-only, and the Requery() of the ComboBox could be fired in that same method to populate the list.

If you still think you're stuck with a TextBox control, then you could still use the collection approach -- fire the method for each row that populates the Value of the TextBox from searching the collection for the desired key value. You could also accomplish this by using BINDEVENT to hook a method to whatever property (Value, grid row control, whatever) you needed and, in the delegate method, searching a table/collection and populating the TextBox with your desired string.

Just a couple of thoughts...


>Based upon no suggestions since my original question it appears that there may be no straightforward / pure "ControlSource" solution to my display question.
>
>If someone else has a similar display question, here is my solution:
>
>The Issue:
>In a grid's TextBox control I needed to display a text string based upon a field's key value, i.e. "Acme Company, Inc." from a key value "00012345". This would be simple in a ComboBox however the control must be READONLY and STYLE = 0, Dropdown Combo, apparently cannot be made READONLY.
>
>My Solution:
>I resorted to a child cursor (of the company names) with an index tag of the names' key values. Then, from the parent cursor (grid's RECORDSOURCE), I set a relation (the key value) into the child cursor.
>
>I ideally wanted to avoid a SET RELATION and, instead, handle the display issue basically within the control itself.
>
>If anyone has an "ideal" solution (like just described) I'd still appreciate hearing it. Thanks.
Evan Pauley, MCP
Positronic Technology Systems LLC
Knoxville, TN

If a vegetarian eats vegetables, what does a humanitarian eat?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform