Hi,
I have a grid build from a DBF table. One of the columns is set to the value "STATUS='A'". This resolves into .T. or .F.
I want to shows this in the grid as a check box. And I can dynamically replace the column from text to the check box as follows:
.RemoveObject( "Text1" )
cNewControlName = "." + ALLTRIM( GRID_DATA.OPT_CONTR1 )
.AddObject( ALLTRIM( GRID_DATA.OPT_CONTR1 ), ALLTRIM( GRID_DATA.OPT_CONTR2 ) )
.sparse = .F.
The value in OPT_CONTR2 is "CHECKBOX_CONTROL"
The value in OPT_CONTR1 is "STATUS" (or whatever word I choose).
The PRG has a function "CHECKBOX_CONTROL" which simply looks like this:
DEFINE CLASS CHECKBOX_CONTROL AS CHECKBOX
OPT_CONTR1 = ""
OPT_CONTR2 = ""
OPT_CONTR3 = ""
OPT_CONTR4 = ""
OPT_CONTR5 = 0.00
OPT_CONTR6 = ""
OPT_CONTR7 = .F.
OPT_CONTR8 = .F.
ROW_HEIGHT = 0.00
ENDDEFINE
The above shows all rows in the grid as a checkbox. However, regardless of the value (STATUS="A" or STATUS="I"), the check box has a caption equal in OPT_CONTR1. If the value in OPT_CONTR1 is "STATUS", all rows show the checkbox with the caption STATUS.
I would like the caption to change, depending on the value in the field STATUS. For example, when the STATUS="A", the caption should say "Active". When the value in the row is STATUS="I", the caption should say "Inactive."
How do I do it?
TIA
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham