Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Takes too long to SEEK
Message
 
 
À
05/12/1997 17:34:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00064114
Message ID:
00064421
Vues:
38
>>>>>I have a search form that uses the ingrid control in a grid to incrementally search members in out database. (125,000 records in the member table)
>>>>>The form works beautifully except for one thing: When the pointer is positioned on a record that begins with a letter somewhere in the middle of the list (Doesn't begin with 'A'), Searching for a name beginning with 'A' gives incorrect results:
>>>>>type: "ABART"
>>>>>positions the pointer on "BART"
>>>>>The reason this happens is that the control starts the search string over after a certain timeout value is elapsed, and searching on 'A' takes long enough for the search to time out and start the string over. I can adjust the timeout value (it is currently 1.5 seconds) to accomodate the problem, but that would defeat the purpose of the timeout.
>>>>>The strange thing is it only takes too long with the letter 'A', and no other letters.
>>>>>
>>>>>-OK I just did some testing. From the command window, 'A' takes just as long to search as the other letters. This leads me to believe that the delay is the grid repositioning itself.
>>>>>I have found a user workaround and that is to type 2 'A's when searching for a name that starts with 'A'. The first 'A' lets the search time-out and the second 'A' is searched succesfully.
>>>>>The delay seems to be only when the grid has to go to the very top, not any other position.
>>>>>This inconsistency is pretty odd.
>>>>>Does anybody know a way around it?
>>>>Hi,
>>>>Do you have an index tag on the field. With cSeekTag set to tagname, ingrid and grid refresh is instant no matter how many recs you have and what you search.
>>>>Cetin
>>>
>>>Cetin, if it s within your means, please try this situation and report your results. I use the Ingrid control on well over 20 forms, and the search result time is NOT the same depending on number of records. I am well aware that I need indexes on appropriate fields, your assumption that grid refresh rate doesn't change is simply wrong.
>>
>>Erik:
>>
>>I have had problems similar to yours with the InGrid incremental search. No matter what I did, my users hated the way it behaved. I finally abandoned that control in favor of an incremental search TextBox that I placed right above the grid and place a label next to it that says "Search". Once they hit the record they want, they can either hit the Enter key which takes them directly to the correct record in the grid below, or they can click off to where ever they want to go. They are much happier. I have this subclassed with 3 custom properties and all I have to do is drop it on a form.
>
>I too didn't like the control the way it was when I got it. But after making a few changes, it tamed quite nicely. I don't think the problem here is with that control, though. It is with the grid. None of this would be a problem if it weren't for the timeout feature, which I think is needed.
>
>In your control, what triggers the actual search? If it is the keypress event, how does the control know if it is continuing a string or starting fresh? Does it just clear when it gets focus? Is the user responsible for clearing it out with delete or backspace?

I had it originally to select the entire text when the textbox got focus. Users did not like that because they wanted to just overwrite whatever they wanted. So I made the users responsible for "cleanup" of existing text when got focus. The KeyPress event is what triggers search. My users understand that whatever is in the textbox is what gets searched for. I have had no complaints. When I get back to work, I'll see about uploading it to the UT.
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform