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!

Hide Grid Row

Status
Not open for further replies.

CajunCenturion

Programmer
Mar 4, 2002
11,381
US
Is it possible to programmatically hide certain rows of a grid if the values in one column meet some criteria?

Thanks.

--------------
Good Luck
To get the most from your Tek-Tips experience, please read
FAQ181-2886
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Is it possible to programmatically hide certain rows of a grid if the values in one column meet some criteria?

Thew short answer is no. Instead, create a view that excludes the records you do not want to display and use the view as the grid's RecordSource instead.

Marcia G. Akins
 
Thank you.

--------------
Good Luck
To get the most from your Tek-Tips experience, please read
FAQ181-2886
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
I have a Field called Active on almost all my Tables. And Set filer to Active = .T. or Active =.F. works on my grids. I have a button on the form and the click method is
Code:
SELECT (THISFORM.fcParentDbf)
lcCaption = UPPER(ALLTRIM(THIS.CAPTION))

DO CASE
CASE lcCaption = "IN WORK"
	THIS.CAPTION = "Complete"
	SET FILTER TO Lactive = .F.

CASE lcCaption = "COMPLETE"
	THIS.CAPTION = "No Filter"
	SET FILTER TO 

OTHERWISE
	THIS.CAPTION = "In Work"
	SET FILTER TO Lactive = .T.

ENDCASE

THIS.REFRESH()
THISFORM.grd_Jobs.REFRESH()

So why a filter on another field will not work.

If you are using a backend engine and a view, I do not know the results, Never tried it, But it seems to me you can annd that as part of the view query of SQLEXEC command.


David W. Grewe Dave
 
Another word of caution...

Scroll bars and the thumb don't work properly in a filtered grid.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top