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!

How to make grids rows individually disabled

Grids

How to make grids rows individually disabled

by  Mike Gagnon  Posted    (Edited  )
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:
Code:
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:
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:
Code:
WITH THIS
   .column1.DYNAMICCURRENTCONTROL = "thisform.dynamic()"
   .column2.DYNAMICCURRENTCONTROL = "thisform.dynamic()"
ENDWITH

Mike Gagnon

Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top