Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Displaying value other than controlsource in grid
Message
 
 
To
09/02/1999 17:42:15
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00185208
Message ID:
00185810
Views:
17
>>>>I have a grid based on a view that contains a listbox that displays a value other than the controlsource. The listbox is BoundTo a surogate key that is not displayed in the listbox (columnwidth = 0). Using Sparse = .f. the screen update is too slow and looks horrible. With sparse = .t., the grid displays the surrogate key.
>>>>
>>>>How can I diplay the same value in the listboox.displayvalue when the column does not have focus?
>>>>
>>>>Thanx in advance.
>>>
>>>Dean,
>>>
>>>Could you expand on this a bit? I'm not sure I follow completely. It sounds almost like you're putting a listbox in a grid. Want to make sure I understand before I start offering advice.
>>>
>>>Regards,
>>>Jason
>>
>>Jason, Yes, the listbox is in a grid. The situation is further complicated because the BoundColumn is a key in a related view (which is working fine). I show fields from the relation in other controls on the form. But with sparse off, my surrogate key is displayed. It means nothing to the user, and I would rather not show it to them.
>>
>>thanx,
>>Dean
>
>Okay, for the dropdown, Add the descriptive column to your record source. Just as an FYI, I don't bind controls to an alias, rather to an SQL statement, though either will work. Make sure both your descriptive column and your key column are included. Put the descriptive column first, and set the boundcolumn property of the dropdown to two, and the columncount property to 1. This will display your descriptive column but not your key value, but when you reference the value property of the combo, it will be the key value.
>
>
>Regards,
>
>Jason

Jason, The dropdown is setup as you suggest. and it works fine. I use the dropdown on the next page of a pageframe. It works. I was trying to get this to work in a grid with Sparse on (screen update was horrible with Sparse off). In the grid, when not selected, the column shows a textbox with the bound value in it. You can't, or aleast I haven't been able to manipulate that control. The one that displays the value when the column doesn't have focus. Again it works really well outside the grid.

Anyway, for a work around, I am using two columns in the grid to get the job done. One bound to the key field, the other bound to the desciption field (in a differnt view, tied together by a relation setup in the form init). I don't want to requery() on every edit. I would like to make it nicer but I can't spend any more time on it right now.

Thanks for the help
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform