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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read-only row

Status
Not open for further replies.

Stokesy

Programmer
Jan 17, 2002
14
0
0
GB
Is there anyway I can make a row on a grid read-only depending on the value of a check box?
 
Try putting this code in your grid's AfterRowColumnChange event:
Code:
this.readonly=lPerm
In the above code, lPerm is the name of the logical field in the table. If the field is .T., the grid will be read only. If .F., it will be changeable.
 
I only want one row to be made read-only if the check-box is selected
 
The code I listed will change the grid's ReadOnly attribute based on which row you're in. Try it and you'll see what I mean. :eek:)
 
Thats fantastic.

To be picky tho - can we do it for just one cell?

Thanks again,
James
 
HI

The WHEN clause of the column hold the key to work it around. Put in all other columns.Text1.When event..
IF myCheck = .t.
RETURN .T. or .F.
ELSE
RETURN .F. or .T.
ENDIF

This code will not allow the focus to be put on those cells.SO only the column with the check mark in that row will get the focus, since that shall not have the when event code.

Be it READ ONLY or no focus.. the purpose is achieved. :) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
If there is only one cell you want to make readonly, then change the code:
Code:
this.column1.readonly=lPerm
This will make only the first column readonly. You can, of course, pick any column you want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top