Hi
This code has dynamicBackColor
Does this do what you are asking.
With thisform.pageframe1.page1.grid1
.Top=.parent.button_options.Height+5
.Left=0
.Height=Thisform.pageframe1.Height-.Top-30 &&
thisform.pageframe1.page1.button_options.Top-20
.Width=Thisform.pageframe1.Width
.Visible=.F.
.Left=0
.GridLines=0
.RecordMark=.F.
.DeleteMark=0
.RecordSourceType=1
.RecordSource="sop_h"
.HighlightStyle=2
.AllowCellSelection=.F.
.highlightbackcolor=RGB(0,0,0)
.gridlines=2
.ColumnCount=6
.Columns(1).Name="column1"
.Columns(1).ControlSource="sop_h.sh_fabref"
.Columns(1).Width=80
.Columns(1).HEADER1.Caption="Sales No"
.columns(1).alignment=0
.Columns(2).Name="column2"
.Columns(2).ControlSource="sop_h.sh_name"
.Columns(2).Width=300
.Columns(2).HEADER1.Caption="Name"
.Columns(2).alignment=0
.Columns(3).Name="column3"
.Columns(3).ControlSource="sop_h.sh_custref"
.Columns(3).Width=250
.Columns(3).HEADER1.Caption="Order Ref"
.Columns(3).alignment=0
.Columns(4).Name="column4"
.Columns(4).Controlsource="sop_h.sh_orddate"
.Columns(4).Width=100
.Columns(4).HEADER1.Caption="Date Raised"
.Columns(4).alignment=0
.Columns(5).Name="column5"
.Columns(5).ControlSource="sop_h.sh_nett"
.Columns(5).Width=100
.Columns(5).HEADER1.Caption="Value"
.Columns(5).alignment=1
.Columns(6).Name="column6"
.Columns(6).ControlSource="sop_h.sh_status"
.Columns(6).Width=250
.Columns(6).HEADER1.Caption="Status"
.Columns(6).alignment=0
For N=1 To .ColumnCount
.Columns(N).HEADER1.Caption=appTranslate(.Columns(N).HEADER1.Caption)
.Columns(N).ReadOnly=.T.
Next
** .Setall("DynamicBackColor","IIF(MOD(RECNO( ), 2)=0,
IIF(sop_h.sh_status='C',RGB(255,0,0),RGB(255,255,255)),
IIF(sop_h.sh_status='C',RGB(255,0,0),RGB(224,224,224)))", "Column")
.columns(6).dynamicbackcolor="IIF(MOD(RECNO( ), 2)=0,
IIF(sop_h.sh_status='C',RGB(255,0,0),RGB(255,255,255)),
IIF(sop_h.sh_status='C',RGB(255,0,0),RGB(224,224,224)))"
.AutoFit()
.Visible=.T.
.tabindex=5
.Refresh()
Endwith
________________________________
From: [email protected] on behalf of Jeff Johnson
Sent: Fri 25/03/2011 15:30
To: GrahamB
Subject: Grid Cell Question
I would like to display the forecolor and backcolor of a textbox in a
grid based on the value of a the textbox. For example, the value is 1
and I want the cell to be a solid red cell. If the value is 2, I want
the cell to be a solid yellow, etc.
This would be for one column only.
Any ideas?
--
Jeff
---------------
Jeff Johnson
[email protected]
(623) 582-0323
www.san-dc.com
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.