Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why does a grid display search results in the middle?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00068309
Message ID:
00068873
Vues:
47
>>I have a textbox and a grid on a form. The textbox is used to enter a search string. The grid displays the records from an ordered table (just as a browse would).
>>
>>However, the resultant matching record is always displayed in the middle of the grid. Why ?
>>In fpw, the browse window always showed your matching record at the very top of the window.
>>
>>Is there a way to get the grid to mimic the browse window ie: display the matching record(s) from the very top of the grid downwards, instead of from the centre of the grid downwards. ?
>>
>>Would be glad to get help on this, thanks.
>
>My first question would be are you using a filter for the grid data? If so... mmmm... It could be a long night. I always
>use a cursor or a view for grids... Just makes life a lot more livable.

I am using an indexed table with no filter. The table was dragged onto the form from the Data Env. The textbox simply does a "seek" for the search-string in the table. The form is then refreshed. The row(record) that is found is always displayed in the middle of the grid.
The textbox keeps the focus (using a return 0, in the valid event) so that another search string can be entered.

The grid is used to select desired records. If one was looking for names for eg. and the search-string entered was "Sam", the the first record containing "Samantha" is displayed in the middle row, followed by "Samuel", "Sera" etc. All the records(rows) above the middle row are wasted space (these could be the "R's). This grid is used to select desired records, and therefore I want the first matching record(s) to be displayed from the top of the grid, downwards.

I believe the Doscroll command may work, but I have never used it before, and don't know how to call this method from within textbox, so that the textbox retains the focus.
David Wheeldon
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform