Is it possible to use the Find (_med_find) inside a grid like we can inside a browse? I have a menu on top of the form with the system menu options of _med_find,_med_finda,_med_cut... but only the _med_cut works.
have used grids and text search's alot in foxpro, best way i found is to use text box to do incremental search, is fast, check out universalthread.com, goto download section, and search on grid they have a sample code snippet there
You can set the InterActiveChange event of the text box to make a soft seek for the grids text control. You can make the incremental search by adding the lastkey() to the cumulated text value stored as a property to the form.
You can also do a soft seek using KeyPress event.
If the KeyPress event of the form needs to control over that of a textbox, remeber to set the Forms KeyPreView property to .t. This tip will help if you want to expand the interactive change event to capture the down arrow, up arrow, tab, enter or esc keys to do just their default function and not participate in the incremental change. ... example
KeyPree Event of a form.......
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode = 13
ThisForm.Nav_search1.cmdExit.Click()
ENDIF
IF nKeyCode = 5 .AND. !BOF()
ThisForm.Nav_search1.cmdPrevious.Click()
NODEFAULT
ENDIF
IF nKeyCode = 24 .AND. !EOF()
ThisForm.Nav_search1.cmdNext.Click()
NODEFAULT
ENDIF
IF nKeyCode = 18 .AND. !BOF()
SKIP - WROWS()
ThisForm.Nav_search1.cmdPrevious.Click()
NODEFAULT
ENDIF
IF nKeyCode = 3 .AND. !EOF()
SKIP WROWS()
ThisForm.Nav_search1.cmdNext.Click()
NODEFAULT
ENDIF
=================================
There are number of ways to do this search. I hope the above helps.
Ramani
Heres the description: Remember using +F in browse windows for a quick and dirty way to search every field? Its the one feature of the standard grid class that I miss.
This class will allow you to enter a value and then will search column by column, row by row until it finds a match or has gone the whole way around.
There is room for TONS of improvment, but this will get you started! Jon Hawkins
The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.