Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

grid and readonly columns

grid and readonly columns

grid and readonly columns


i have a grid that is populated from tables.
At start i have the readonly property to true and allowcelselection to false and i have a checkbox on the form to check it and make the grid editable. (readonly = f and allowcellselection .t.)

but this makes all columns editable even if i have the readonly property of a specific column set to true.

is this the way it works?
do i have to set each columns property seperately?

RE: grid and readonly columns


If you set the control source to an expression, instead of a simple field or variable reference, your column will remain read-only no matter what.

For instance, (tablename.fieldname) instead of tablename.fieldname.

RE: grid and readonly columns

thank you.
good hints

RE: grid and readonly columns

There's another problem, no matter if you set readonly on the global level of the grid or in single columnns, also via adding brackets, you get a ping sound and a timeout before VFP reacts again whenever you try to type into a readonly column (consider accidently clicking into the wrong column) so you could also avoid that with a RETURN .F. from the When event of the columns control. When using several controls, sparse = .f. and dynamiccurrentcontrol, this also enables to allow editing based on which control is used for a row.

The downside of that is it's more restrictive than readonly, you can't select the cell or text within, you disallow using it as a source for copy&past, you make it less than readonly, you make it disabled.

On the positive side, if that matches your need you have the ability to allow individual cell selection using this cleverly.

Bye, Olaf.

Olaf Doschke Software Engineering

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close