Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Assign Grid Header Click at run time
Message
From
23/10/2002 08:58:30
 
 
To
23/10/2002 08:40:02
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00714297
Message ID:
00714306
Views:
32
>Dear Friends,
>
>I have created a form with a grid which is being filled in at run time during the load method of the form. At design time the grid is empty and columncount = -1.
>
>Now I want to assign a click method to each header, so that when you click on the header it will sort the data inside on ascending or descending order.
>
>How can I do that? Setall does not work for methods and there is no header or grid yet when I design the form.
>
>Any ideas are welcome.
>
>Thanks in advance
>
>Jonathan Feldman

Jonathan,

Best is to (1) Subclass the header, (2) in the grid.init() replace the standard headers with your header (copy all properties from the old header to the new one like font, caption, ...)

The most flexible is to 'forward' the header.Click()/Mousedown/Mouseup/.. to the grid. ie add methods to your grid class like Header_MouseUp, ...

Your grid base class can have a standard way of reacting. In addition, each grid can override the header clicks

eg
&& header
procedure MouseDown
LPARAMETERS nButton, nShift, nXCoord, nYCoord

	do case
	case (nButton == BUTTON_RIGHT )
		NODEFAULT
		=this.Parent.Parent.Click_Right_Header(this.Parent) && call grid method passing column object
        ...
        endcase
endproc
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform