Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why does a grid display search results in the middle?
Message
De
30/12/1997 03:48:17
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00068309
Message ID:
00068384
Vues:
46
>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.

If you just want to mimic you could use doscroll method like this :
* Textbox.lostfocus
=seek(trim(this.value),tTable,cIndex)
thisform.domimic = .t.
thisform.grid1.setfocus() && Needed to fire afterrowcolchange

*Grid.afterrowcolchange
LPARAMETERS nColIndex
if thisform.domimic
	thisform.lockscreen = .t.
	do while this.relativerow > 1     && Do while we are not on first row
		this.doscroll(1)          && Scroll down
	enddo
	this.refresh
	thisform.domimic = .f.            && So other movement in grid doesn't scroll
	thisform.lockscreen = .f.
	thisform.text2.setfocus()   && Whatever the next control to search textbox
endif	
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform