Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Search on more than one column in grid
Message
 
 
À
22/01/2015 03:53:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01614032
Message ID:
01614069
Vues:
33
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); && cLitteral() makes a litteral out of any value - tell me if you need it
>   )
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform