Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox in grid - 1st keypress clears drop down?
Message
From
12/12/2006 20:42:17
 
 
To
08/12/2006 06:55:00
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01175455
Message ID:
01177029
Views:
16
>Thanks Sergey - I really do appreciate your feedback! To be honest though, I guess my nature is to be perseverant, almost to a fault. In time, I may very well end up using someone else's replacement combobox control - but as a newbie I'd rather learn the base controls and their quirks/features.
>
>Using a custom sub-class is not the same as using a "replacement" control. A subclass is merely a customized version of the class as it comes out of the box to provide either a standard look and feel or some additional functionality. The advantage of creating a custom class, is that you can use this class in any form without the necessity of having to write the same code over and over and over again or using VB6 inheritance ( copy and paste ).

Ahhh, yes I read your article (from Sept 2000 on ComboInGrid) again and I see that you are working with the native combobox. I have found that most of the quirks with combos in a grid are resolved in VFP 9 (I was using 6). e.g. up and down arrows

One problem that I still have not figured out is: why does the combo's dropdown list close as soon as I type any character? I have a typical invoice form, with a grid for the invoice detail lines. The grid's properties are: Style = 0 - Dropdown Combo; ColumnCount = 2; RowSourceType = 6 - Fields; RowSource = LookupTable.ItemKey,ItemDescription; BoundColumn=1, ControlSource = InvDetail.ItemKey. In the form's Init I append a record to InvDetail, leaving ItemKey field blank. When I click on the grid's combobox down gadget, the list drops down for an instant then closes. If I click on it again, it stays open. So actually I have 2 problems, this being the first. I believe this problem is because the combobox's value is blank, and has no corresponding match in my LookupTable. If I initialize InvDetail.ItemKey to a key value that does exist in LookupTable, then the dropdown behaves properly in this regard. Interestingly, if the combo is moved from the grid to the form, the combobox no longer manifests this problem (even with a blank InvDetail.ItemKey).

Once I do get the dropdown to open, as soon as I type my first character it closes - making incremental searches impossible. It does seek to the first matching key that starts with the character I typed - and returns that value to the combo's text box.

I did just discover that incremental searches are governed by the new _IncSeek system var (used to be _DblClick) and thought maybe the default of .5 was my problem. But increasing it to 4 seconds did not help. The list closes within a fraction of a second after I press any key. _IncSeek should only affect how quickly VFP resets the search key, right? It should not cause the dropdown to close. I wonder what condition(s) cause a dropdown list, with IncrementalSearch = T , to close???

Sorry this message is so long - I'm just trying to anticipate questions :)

Many thanks - Mike.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform