Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo box confusion...
Message
From
19/12/2001 16:58:56
 
 
To
19/12/2001 15:11:56
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00595880
Message ID:
00596480
Views:
23
This message has been marked as a message which has helped to the initial question of the thread.
Hello David.

>Marcia,
>One thing I forgot to mention in my last reply is this; If you have the same senerio as in my combobox question (table1.description, textid stores the descriptions along with the primary key. Master1.text1 stores a list of foreign keys from table1). How can you apply this to a grid? The grid's record source is master1 and its column controlsource is master1.textid. That column has the combobox as its current control. When the grid runs, however, the column displays master.textid. How can you have it display the proper description from table1.description?
>
>Thanks again for your help.

Set the column's Bound property to false and set the ControlSource like this:

( IIF( SEEK( Master1.textId, 'Table1', '< textId Tag >', Table1.Description, '' ) ) )

Combo properties as follows:

Style = 2-Dropdown List
BoundColumn = 2
ControlSource = 'Master1.TextId'
RowSourceType = 3-SQL
RowSource = 'SELECT description, texid FROM Table1 ORDER BY description INTO CURSOR Temp'

The reason that you can't use a RowSourceType of 6-Fields is that the combo in the grid will be blank when the combo has focus.

This technique only works with Drop Down Lists because, even though setting up the Column's ControlSource like this has the effect of making the column ReadOnly, ReadOnly only applies to the portion of the control that accepts text. A Dropdown list does not accept text. Therefore, you will still be able to change the values in that cell of the grid using the combo.

Or, you could leave everything the way you have it and set the column's Sparse property to false. But this results in combos being displayed in every row in the grid. Personally, I think that makes the grid look cluttered and busy.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform