INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

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.

Jobs

Grids

How to make grids rows individually disabled by mgagnon
Posted: 15 Aug 02 (Edited 21 Nov 02)

1. Create a blank form (not the wizard) and put a grid (set the column count to 2)
2. In column1 and column2 add a second textbox as a possible currentcontrol (edit the property of the textbox and set the enabled to false)

3. In the load of the form put:

CREATE CURSOR myCursor (name c(20),color c(10))
INSERT INTO myCursor (name,color) VALUES ("Mike","Blue")
INSERT INTO myCursor (name,color) VALUES ("John","Red")
INSERT INTO myCursor (name,color) VALUES ("Frank","Yellow")
INSERT INTO myCursor (name,color) VALUES ("Joe","Black")
GO TOP

4. Create a method in the form (call it "dynamic" for the purpose of this example) and in the method put this code:

DO CASE
CASE myCursor.COLOR = "Blue"
    RETURN "Text2"
CASE myCursor.COLOR = "Yellow"
    RETURN "Text2"
OTHERWISE
    RETURN "Text1"
ENDCASE

5. Lastly, in the init of the grid put this code:

WITH THIS
   .column1.DYNAMICCURRENTCONTROL = "thisform.dynamic()"
   .column2.DYNAMICCURRENTCONTROL = "thisform.dynamic()"
ENDWITH


Mike Gagnon


Back to Microsoft: Visual FoxPro FAQ Index
Back to Microsoft: Visual FoxPro Forum

My Archive

Resources

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