Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting Filter on listbox
Message
De
15/12/1997 09:51:53
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, États-Unis
 
 
À
15/12/1997 09:41:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00065892
Message ID:
00065907
Vues:
38
>>>>I have a VFP5 form that contains a Grid control. One of my routines sets a
>>>>FILTER and refreshes the Grid just fine.
>>>>
>>>>However, I changed the control to a Listbox and when I SET FILTER TO ,
>>>>the Listbox shows the results for about a second and then goes blank. I check
>>>>FILTER() and it returns nothing like the filter was not set and
>>>>when I tab to the Listobx, the Listbox shows every record and ignores the filter.
>>>>
>>>>Can you set a filter and have the results shown in a VFP5 Listbox?
>>>>
>>>>Thanks,
>>>>
>>>>Jerry Tovar
>>>
>>>After you set a filter on List.Rowsource, you should issue List.Requery to bring up new contents.
>>
>>I do issue a listbox.REQUERY() and a listbox.REFRESH() but the filter is still cleared.
>>When I do a WAIT WINDOW FILTER("tablename") it returns blank. However the same thing
>>works in a Grid just fine. It's like something is clearing the filter.
>>
>>Is it possible to set a filter and change the filter in a Listbox?
>>
>>Thanks,
>>
>>Jerry Tovar
>
>You set filter on table which is Listbox.Rowsource and it should work Ok. However, listbox itself has problems working with more that 250 items (this case grid is highly recommended). Also, note that collecting records into cursor and populating grid using cursor alias is always more reliable way than filtering.


What seems to be happening is that;

THISFORM.myfilterproperty = "A"
SET FILTER TO mytable.myfield = THISFORM.myfilterproperty

This works fine with a Grid control but will not work in a Listbox control. However, if
I define a Public Var and SET FILTERTO the public var, this will work in a Listbox.

Not sure if this is correct behaviour.

Thanks,

Jerry Tovar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform