*** test.prg ***
CREATE CURSOR tt (f1 I, f2 I)
FOR i=1 TO 100
INSERT INTO tt VALUES (i, i%10)
ENDFOR
GO TOP
of = CREATEOBJECT("form1")
of.show(1)
RETURN
DEFINE CLASS form1 as Form
ADD OBJECT cmd as commandbutton WITH top=10,left=10,height=22,caption="test"
ADD OBJECT grid1 as grid WITH top=40
PROCEDURE cmd.click
this.Tag = IIF(this.Tag=="1","","1")
IF this.Tag=="1"
SET FILTER TO f1%2==0
ELSE
SET FILTER TO
ENDIF
GO TOP
thisform.grid1.setfocus
ENDPROC
ENDDEFINE