If you want to disable and show a grid 'greyed out', the default .DisabledBackColor for a textbox is white, while you perhaps run an external application or something similar, try the following code.
The default .DisabledBackColor for a textbox is white
You will need to replace the various values with those relevant to your application.
You will also need to change the .DisabledBackColor property of any checkboxes you may have in a column(s) to say RGB(128,128,128) to prevent white showing as the background colour.
The example shows the selected row highlighted and these values will also need examining.
[color blue]
WITH THISFORM.Grid1
.SetAll([BackColor],RGB(212,208,200),[Column])
.SetAll([ForeColor],RGB(128,128,128),[Column])
.SetAll([ForeColor],RGB(128,128,128),[Header])
.SetAll([DynamicBackColor] ,;
"IIF(RECNO([TABLENAME]) = THISFORM.nRecNo ,;
RGB(212,208,200) ,;
RGB(212,208,200))" ,;
[Column])
.SetAll([DynamicForeColor] ,;
"IIF(RECNO([TABLENAME]) = THISFORM.nRecNo ,;
RGB(128,128,128) ,;
RGB(128,128,128))" ,;
[Column])
.Enabled = .F.
[tab].Refresh()
ENDWITH
[color green]
* Run other process and then enable grid
[color blue]
WITH THISFORM.Grid1
.SetAll([BackColor],RGB(255,255,255),[Column])
.SetAll([ForeColor],RGB(0,0,0),[Column])
.SetAll([ForeColor],RGB(0,0,0),[Header])
.SetAll([DynamicBackColor] ,;
"IIF(RECNO([TABLENAME]) = THISFORM.nRecNo ,;
RGB(10,36,106) ,;
RGB(255,255,255))" ,;
[Column])
.SetAll([DynamicForeColor] ,;
"IIF(RECNO([TABLENAME]) = THISFORM.nRecNo ,;
RGB(255,255,255) ,;
RGB(0,0,0))" ,;
[Column])
.Enabled = .T.
[tab].Refresh()
ENDW
[color black]
Have fun!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.