Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: Russell Hill
  Where is Russell Hill?
 Sydney
 Australia
 Russell Hill
 Tags
Subject: RE: Grids, indexes & filters
Thread ID: 155117 Message ID: 155166 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Wednesday, December 26, 2007 6:11:39 PM         
   


> Hi all,
>
> What are the pros and cons of using indexes & filters on a Cursor which is the RecordSource for a Grid?
>
> The user needs to be able to sort the Grid on any of it's columns and also filter out subsets of data.
>
> I'm not so much concerned about sorting the data (presumably I just use INDEX ON or SET ORDER TO) but should I:
>
> 1. Use XBase SET FILTER TO commands on MainCursor
>
> or
>
> 2. Use SQL SELECT statements FROM MainCursor INTO FilterCursor and change the RecordSource of the Grid?
>
> Are there any known issues with either strategy?
>
> Thanks,
>
> Russell.

1) You may. VFP9 does filtering much better than previous versions. However, with a grid still I wouldn't recommend (my #1 reason not to use is the scrollbar behavior).
2) You don't need to create a special cursor and/or change recordsource. Alternatively you could:
a) Just use "set key to" if would do filtering on a single indexed column
b) Use a recordsourcetype of 4-SQL and to refresh:
this.RecordSource = this.RecordSource


Cetin Basoz

ENTIRE THREAD

Grids, indexes & filters Posted by Russell Hill @ 12/26/2007 9:15:34 AM
RE: Grids, indexes & filters Posted by Andy Kramek @ 12/26/2007 12:16:00 PM
RE: Grids, indexes & filters Posted by Russell Hill @ 12/26/2007 7:52:25 PM
RE: Grids, indexes & filters Posted by Cetin Basoz @ 12/26/2007 6:11:39 PM
RE: Grids, indexes & filters Posted by Russell Hill @ 12/26/2007 7:52:53 PM