Hi Thierry,
I will print and review your approach to see how to apply it.
Thank you very much.
>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.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham