Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter Data on a Grid 1

Status
Not open for further replies.

Gert

Programmer
Apr 9, 2000
240
DO
Hi all
I go a table with 6000 record, and what I would like to know is how could I code a Command Botton to filter on the grid only the field I wish to show up without creating and sql to store data in other table..

Thanks


 
look up the set filter command.

Make sure that the field you are filtering on has an index on it.

Even with the index, however filtered tables in grids tend to have terrible performance.

You may want to look at using a local parameterized view.

Please look up views in the documentation Before asking your next question. :)
 
In the CommandButton click event, you can add a functionality similar to Find Button code of the default wizard navigation find button. This will enable you to choose whatever field you want and also set the filter as you need with even multiple fields. Hope this helps you. If you need more on this topic, you can post again or ask for it here.
Best of luck
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
You could consider using a local index that filters oput the data you wish to be shown.

I used to work with a package that used this methodology. It works quite fast (relatively of course).

HTH, Weedz (Wietze Veld) They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best. - Steve McConnell
 
Hi!

If you meant the showing/hiding of columns in grid, show all columns, but for all columns you want to hide set the properties:
width=0, movable=.F., resizable=.F.
Each time you want show some column, just set these properties back to normal values.

If you meant filtering by certain value, do not do this. Grid is slow with filtered data because it does not use rushmore optimization when going top/bottom (does not use the indexes). I would also suggest to use the view. Or, if you filter records by some key values, SET KEY command that is quick with grids.

Hope this helps.

Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
I have seen different answers # or row vs. # of columns.

If this is for tthe # of rows, why not consider a parameterized view for your data source?

Now you are only a refresh() away from presenting the data you want.

__Stephen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top