Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid classes and Header method code
Message
From
03/12/1999 07:27:15
Rex Mahel
Realm Software, Llc
Ohio, United States
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00297240
Message ID:
00298338
Views:
23
Nadya,

The builder would look something like:
aSelObj(laObjects)
FOR EACH loObject IN laObjects
	IF UPPER(loObject.BaseClass) # "GRID"
		LOOP
	ENDIF
	FOR EACH loColumn IN loObject.Columns
		FOR EACH loColObject IN loColumn.Controls
			IF UPPER(loColObject.BaseClass) # "HEADER" OR ! EMPTY(loColObject.ReadMethod("Click"))
				LOOP
			ENDIF
			loColObject.WriteMethod("Click","this.parent.parent.setorder(this,this.parent.controlsource)")
		ENDFOR 
	ENDFOR
ENDFOR
The aSelObj takes all selected objects and places them in the laObjects array
For each object, check if it is a grid. For each grid, take each column and find the Header. In each header, check the Click method for code. If empty, add the call to the Grid.SetOrder method in the Click method.

That's all there is to it

HTH

Rex


>Rex,
>
>Could you please give me some clarification, how to do this, because I've never did it before? I just put this code directly on the grid.header Right Click event on each column on my form.
>So, I'm really interested in more general approach.
>
>>>two options you have are
>>>create a grid with more columns that you need (i.e. max number of columns you use) and remove column in run-time
>>>the second is to create the class definition for the column, header etc. in code (in a PRG) and add them in run-time
>>>
>>>Arnon
>>
>>Third option is to create a builder and run it against the grid
>>
>>HTH
>>
>>Rex
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform