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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sorry to bring the highlight row subject up again, but

Status
Not open for further replies.

MForrest

Programmer
Jun 9, 2003
85
0
0
GB
hiya all

I have been trying to flick through the info about this but find it all a bit overwhelming,I have used the following code, the row in grid1 (the main order) selected by the user is highlighted and the query (order lines) is performed and display in grid2. I am getting the following message each time a row is highlighted:

"Expression is invalid.Use a valid expression for DYNAMICBACKCOLOUR and DYNAMICFORECOLOUR properties"

All this is on the click event of grid1.column1.text1:

LOCAL isCurrent

isCurrent = thisform.grid1.column1.text1.value

SELECT all_orders
GO TOP
*!* LOCATE FOR all_orders.wo = isCurrent
with thisform.Grid1
.SetAll([DynamicBackColor],"IIF(all_orders.wo == isCurrent,RGB(0,0,128),RGB(255,255,255))",[Column])
.SetAll([DynamicForeColor],"IIF(all_orders.wo == isCurrent,RGB(255,255,255),RGB(0,0,0))",[Column])
.Refresh()
endwith

thisform.grid2.recordsource = "dummy_clients"

select order_line.orderline_no, ;
order_line.description, ;
order_line.pointnos, ;
order_line.rail_section, ;
order_line.qty, ;
order_line.status ;
from order_line ;
where order_line.wo == isCurrent ;
order by order_line.orderline_no ;
into cursor query_items

thisform.grid1.REFRESH()
thisform.grid2.recordsource = "query_items"

Any advice??
 
You are using a variable
isCurrent

Is this a public variable of the same type as all_orders.wo ?

If this is .t., you can simply use..


with thisform.Grid1
.SetAll([DynamicBackColor],"IIF(all_orders.wo, ;
RGB(0,0,128),RGB(255,255,255))",[Column])
.SetAll([DynamicForeColor],"IIF(all_orders.wo, ;
RGB(255,255,255),RGB(0,0,0))",[Column])
.Refresh()
endwith

But if it is a property of the form.. then..

with thisform.Grid1
.SetAll([DynamicBackColor],"IIF(all_orders.wo ;
== ThisForm.isCurrent,RGB(0,0,128), ;
RGB(255,255,255))",[Column])
....


:)

____________________________________________
ramani - (Subramanian.G) :)
When you ask VFP questions, please add VFP version.
 
Hi ramani, thanks for your help

I cant get either of the following code to work though [sad]

isCurrent is a public variable which stores the work order number of the selected record, all_orders is a cursor which contains details from a client table and details from an order table. I was trying to use the variable isCurrent as an indicator to which record in my grid should be highlighted. As you can imagine Im new to this and think I may be trying to use SetAll incorrectly, I only want to highlight the record selected which is made up of five columns in the grid, do I have to write my code to specifically highlight each column individually??
 
If you want all the cells of a row to be highlighted, you dont need to put the code in each column. SetAll will do that for all the column controls.

The code in this FAQ should guide you to code..
A sample Search Form.
FAQ184-2858

:)


____________________________________________
ramani - (Subramanian.G) :)
When you ask VFP questions, please add VFP version.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top