Hi Dmitry
What I usually do (pseudo-code):
procedure form.load
thisForm.oFilter = create('empty')
procedure form.filterSet
lparameters filterCriterium, filterValue
addproperty(this.oFilter, filterCriterium, filterValue)
cFilter = '.T.'
for each filterCriterium in this.oFilter
uFilter = eval('this.oFilter.' + m.filterCriterium)
cFilter = m.cFilter +iif(isnull(m.uFilter);
, '';
, ' and ' + m.filterCriterium + ' = ' + cLitteral(m.uFilter);
)
endfor
set filter to &cFilter in this.grid.recordSource
procedure grid.init
for each column in this
addproperty(header, oFilterCntl, <filter control such as texbox>)
addproperty(this.oFilterCntl, <filter criterium>, .null.)
endfor
procedure header.click
this.oFilterCntl.visible = .T.
procedure oFilterCntl.Valid
thisForm.filterSet(this.filterCriterium, this.Value)
>Hi,
>
>I am thinking of how to implement the following functionality and looking for suggestions.
>
>Current Design:
>When a desktop application window with a grid is open, for example, List of Parts, user can click on the header of any column and make this a searchable column. The index tag is then set to the clicked column field and user can start typing into a Search text box. Where the program dynamically shows/looks for just the items matching the entry.
>
>Future Enhancement:
>I want the user to be able to click on the second (and possibly third) column (after they performed the search as in the step above). And allow user to narrow down the search by another column of the grid.
>
>I can add a Filter feature where user would specify all his/her query condition and then search the database and display the results. But I am hoping there is a way to make this work dynamic (just like searching on one column).
>
>TIA for any suggestions.
Thierry Nivelet
FoxinCloud
Give your VFP application a second life, web-based, in YOUR cloud
http://foxincloud.com/Never explain, never complain (Queen Elizabeth II)