Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Item selected in combobox
Message
From
28/03/2000 10:26:19
 
 
To
28/03/2000 09:11:14
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00349294
Message ID:
00351386
Views:
27
Hi Christian.

>> Yes, I should have said that this is an autofill combobox, so the user cannot type anything in it what is not in the list anyway. Very nice, btw, like in quicken. <<

I know. Tamar Granor presented one at DevCon 97 in San Diego and wrote an article about its construction in FPA September 1998. I also have one of my own. They are very nice for the end-users and give the app a polished appearance.

>> The problem is, that when the user is ready with editing this field, something else should happen (apply filter in cursor and show in grid).
I cannot use interactivechange, because this would apply the filter for each keystroke. I don't want to use lostfocus, because this is not logical for the user. When the user selected something from the list (with the mouse), he/she expects to see the grid updated right away. <<

First of all, I would get rid of the filter on the grid's RecordSource. Filters in grids are not Rushmore optimizable and if you have very many records in the grid, performance will be abysmal. You would be better off to create a paramterized view and bind the grid to that.

Having said that, I assume that your auto-fill combo has a method called 'Search' or 'HandleKey' or something like that that does the searching in the specified alias. I would add come code to that method of the combo in the instance that does something like this:

DODEFAULT( < parameters, if any > )
lcValue = This.Value
SELECT ( Thisform.MyGrid.RecordSource )
SET FILTER TO < Some Condition >
*** If the RecordSource if a paramterized view, just set the parameter and requery here
Thisform.MyGrid.Refresh()

If your combo has a property to save the original value before the current keystroke, you can check to see if the value has changed before executing code similar to what I have above.

You will need to play with this a bit. It is untested and off the top of my head.

HTH

Marcia
Previous
Reply
Map
View

Click here to load this message in the networking platform