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!

DISACTIVATE LINE IN GRID

Status
Not open for further replies.

Mistral2

Technical User
Nov 12, 2002
21
TN
Dear all,

in a control grid:

CODE NAME PRICE NEW
125 Name1 1.25 .F.
135 NAME2 1.35 .F.
148 Name3 2.78 .T.
...................................
.............................


How to disactivate the lines only of which the value of the logical field NEW=.F. and to let the other (NEW =.T.) active in a control grid.

I have tried to write: ( in the refresh of THISFORM.GRID.COLUMN1.TEXT1)


IF THISFORM.GRID.COLUMN4.TEXT1.VALUE
THISFORM.GRID.COLUMN1.ENABLED=.F.
THISFORM.GRID.COLUMN2.ENABLED=.F.
THISFORM.GRID.COLUMN3.ENABLED=.F.
ELSE
THISFORM.GRID.COLUMN1.ENABLED=.T.
THISFORM.GRID.COLUMN2.ENABLED=.T.
THISFORM.GRID.COLUMN3.ENABLED=.T.
ENDIF

but it don't work fine.

THANKS
MISTRAL
 
That's not going to work you would need a dynamic enabled feature which VFP doesn't have.

What you can do though is put two controls in each column and use the DynamicCurrentControl layout option to pick the ones that are shown:

Code:
** in the forms init method...
THISFORM.MyGRID.COLUMN1.DYNAMICCURRENTCONTROL="IIF(MyTable.New,'Text1','Text2')"

THISFORM.MyGRID.COLUMN2.DYNAMICCURRENTCONTROL="IIF(MyTable.New,'Text1','Text2')"

***and so on

Don't forget to disable one of the text boxes and enable the other one!
HTH

Regards

Griff
Keep [Smile]ing
 
Hi

Another way to handle this situation would be..

In each of the Columns Text1.When event.. add the code..

RETURN newField

Suitably change 'newfield' with your field name.
SO if the NewField = .f., the data acceptance will not take place.

:)


ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top