Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassed grid members
Message
From
01/10/1997 17:44:36
 
 
To
01/10/1997 17:38:07
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00052763
Message ID:
00052764
Views:
30
>Dragan-
>the way I have dealt with getting custom controls into a default grid. I have a grid class called smartgrid which pulls my classes in depending on the datatype of the controlsource of the column.

Woops... left out the code
FOR lnCount = 1 to this.ColumnCount
ccolumn = this.Columns[lnCount]
ccolumn.RemoveObject("header1")
ccolumn.AddObject("myheader1","myheader")
do case
case type(ccolumn.controlsource) = "N"
ccolumn.RemoveObject("text1")
ccolumn.AddObject("myspinner1","myspinner")
ccolumn.myspinner1.visible = .T.
case type(ccolumn.controlsource) = "L"
ccolumn.RemoveObject("text1")
ccolumn.AddObject("mycheck1","mycheck")
ccolumn.mycheck1.visible = .T.
otherwise
cColumn.RemoveObject("text1")
ccolumn.AddObject("mytext1","Mytext")
ccolumn.mytext1.visible = .T.
endcase
ENDFOR

Of course you must have already created a header class with something like the following:

DEFINE CLASS MyHeader AS Header
PROCEDURE click
blah, blah, blah
ENDPROC
ENDDEFINE

You probably have something like this already laid out, but I thought I'd offer my solution to see if it gave any ideas. It might seem like jumping through hoops to get a simple outcome, but this class can be dropped on a form and VFP takes care of column sizing and controlsources for you. HTH
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform