Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6SP5 - Unselect Combo selection
Message
From
06/06/2003 08:28:33
 
 
To
06/06/2003 07:53:44
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00795134
Message ID:
00797159
Views:
114
Hi Alan.
>
>The textbox is the currentcontrol, and in the gotfocus, I push the value to the cbo, and switch the currentcontrol to the cbo. In the lostfocus of the cbo, I push the value back to the textbox and switch the currentcontrol back. The grid stays looking neat, and I get the best of both worlds.
>
>But why are you working so hard at it < s > ? This is all that you need to do if the combo is of style 2-Drop Down List.
>
>Set up the grid column like this:
>
>
>Bound = .F.
>ControlSource = ( IIF ( SEEK( MyRecordSource.MyForeignKey, 'MyLookupTable', 'MyLookupTag' ), MyLookupTable.Description, '' ) )
>
>
>Set up the combo with any RowSourceType except for 2-Alias or 6-Fields (using one of these RowSources will make the combo go blank when it has focus) like this:


I'm a bit confused. I just double checked and I have combo boxes in grids using fields and aliases. Why would they go blank? I just looked at one that is set up with a rowsource of 'fields' (VFP7). In this particular case, I don't bother with the technique I described because the number of records is not great in the area where this is used, so the grid looks ok in any case. The grid has a recordsource, the column does not. The column is bound, and the combobox has a rowsource of fields. It doesn't go blank. Is it because I don't set a distinct controlsource for the column?

In another, where I do use that technique, the grid has a recordsource, the column does not and is bound. The combobox has a rowsource of alias and no controlsource. The textbox has a controlsource. Again, the combobox does not appear blank when it has the focus.

>ControlSource = MyRecordSource.MyForeignKey
>BoundTo = .T.
>RowSourceType = 3
>RowSource = SELECT Description, PKField FROM MyLookupTable ORDER BY Description INTO CURSOR csrLookup NOFILTER
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform