Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filtered grid scrollbar tied to unfiltered view of table
Message
From
17/05/2005 21:16:37
 
 
To
17/05/2005 11:45:55
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01014783
Message ID:
01015163
Views:
25
Hi Cetin,

> "Set key to" and/or relations perform better than filter where applicable

Encouraged by your enthusiasm and success, I went back and figured out how to get SET KEY working. I was aware of SET KEY but had never taken advantage of this language feature before.

For those following this thread: A grid that is "filtered" by SET KEY *DOES* display its scroll bar proportional to the number of records included in a SET KEY type "filter". Works like a champ and without any noticeable impact on grid performance. Beautiful!

Note: I did not need to use relations or the grid's parent/child properties to make this work - just the SET KEY command itself.

Here's an overview of how I used SET KEY with the disclaimer that there may be much better ways to do this.
* remember current workarea
local lnSelect
lnSelect = select( 0 )

* need to explictly select cursor, I had problems with SET KEY's "IN" clause
select curYourGridCursor

* clear SET KEY condition ("filter")
set key to 

* set conditions that SET KEY will monitor
* NOTE: This replaces SET FILTER 
* NOTE: nFlag must be an index tag
replace nFlag with 1 for [your filter logic here]

* in my case I use numeric (vs. logical) flags as basis for SET KEY "filters"
set order to nFlag 
set key to 1

* optional
go top in curYourGridCursor
	
* restore orginal workarea
select (lnSelect)
Thanks again for your help on this thread Cetin. I learned a valuable new technique that I encourage others to take advantage of as well.

Regards,
Malcolm
Malcolm Greene
Brooks-Durham
mgreene@bdurham.com
Previous
Reply
Map
View

Click here to load this message in the networking platform