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

how do i use a grid to select one or more rows 1

Status
Not open for further replies.

titoneon

MIS
Dec 11, 2009
335
US
Hi Everyone,
This is is what i would like to accomplish:
1- display the records in a grid
2- be able to select the records/rows i want in that grid
3- print those selected rows in a report
Can i have some clues, tips on # 2, i know i can select the records in a browse and mark them for deletion and then just
"report form whatever for deleted to printer" but since i am still in the process of learning, would like to know if possible a better and more sophisticate way to do it.
Thanks in advance
Ernesto
 
Olaf,
That was exactly what i was looking for, i knew that adding on each column will do it after Mike and JBL help me out, but i was looking for a way to put somewhere where it affect all the columns at the same time on each row that i ticked the check box.
thanks for the tip as well as to the other guys that helped me out
Ernesto
 
Grids also have a Setall method.

The loop is useful if you're going to conditionally set only some columns, but for all of them:

Code:
Grid.SetAll("DynamicBackColor", "whatever", "Column")
 
I tend to set all and then 'unset' the exceptions:

Code:
THISFORM.GRID1.SETALL("DynamicBackColor", "Project_Colour()", "Column")
THISFORM.GRID1.COLUMN1.DYNAMICBACKCOLOR = ""

I also tend to use a udf rather than specifying the condition 'inline' so to speak.

so the above function might look like this:
Code:
FUNCTION PROJECT_COLOUR
	PRIVATE m.COLOUR
	m.COLOUR = RGB(255,255,255)
	DO CASE
	CASE DEAD
		m.COLOUR = m.SCOLOR  && grey
	CASE RENEWAL <= DATE()
		m.COLOUR = m.CCOLOR  && red
	CASE RENEWAL <= DATE()+30
		m.COLOUR = m.BCOLOR  && amber
	ENDCASE
	RETURN(m.COLOUR)

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Griff said:
I also tend to use a udf rather than specifying the condition 'inline' so to speak.

I agree. It separates the logic of the condition from the effect, and makes the actual property more readable.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
FWIW, I think I'd use the ResetToDefault method rather than setting the property to "" to clear the exceptions.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top