General information
Title:
Containers and ActiveX in grids
Hi
The DynamicCurrentControl Property in The Visual FoxPro Language Reference says:
“If the Column's Sparse property is set to true (.T.), only the active cell
in the Column uses the object specified in the DynamicCurrentControl property
setting to display data; the other cells display data using a TextBox."
That seems to be true except when the object is a container
Can anyone provide any help on this?
Thanks in advance,
Joan
Here is the code for the sample form:
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.ADDOBJECT("grid1","_grid")
oform1.grid1.column1.ADDOBJECT("mycontainer","mycontainer")
oform1.grid1.column1.ADDOBJECT("mytextbox","mytextbox")
oform1.grid1.column1.ADDOBJECT("mycombo","mycombo")
oform1.grid1.column1.DYNAMICCURRENTCONTROL="alltrim(myCursor.curcontrol)"
oform1.grid1.column1.SPARSE = .T.
oform1.grid1.column1.WIDTH = 140
oform1.grid1.column2.WIDTH = 140
oform1.grid1.column1.CONTROLSOURCE="myCursor.thename"
oform1.grid1.column2.CONTROLSOURCE="myCursor.curcontrol"
oform1.SHOW
RETURN
DEFINE CLASS form1 AS FORM
TOP = 4
LEFT = -1
CAPTION = "Form1"
NAME = "Form1"
HEIGHT = 400
PROCEDURE LOAD
CREATE CURSOR myCursor (thename c(10), CURCONTROL c(15))
INSERT INTO myCursor (thename,CURCONTROL) VALUES ;
("George","mycontainer")
INSERT INTO myCursor (thename,CURCONTROL) VALUES ;
("Mike","mytextbox")
INSERT INTO myCursor (thename,CURCONTROL) VALUES ;
("Paul","mycombo")
INSERT INTO myCursor (thename,CURCONTROL) VALUES ;
("Anna","mycontainer")
INSERT INTO myCursor (thename,CURCONTROL) VALUES ;
("Carol","mytextbox")
INSERT INTO myCursor (thename,CURCONTROL) VALUES ;
("Ona","mycombo")
GO TOP
ENDPROC
ENDDEFINE
DEFINE CLASS _grid AS GRID
COLUMNCOUNT =2
HEIGHT = 390
VISIBLE = .T.
ENDDEFINE
DEFINE CLASS mycombo AS COMBOBOX
VISIBLE = .T.
PROCEDURE INIT
THIS.ADDITEM('Anna')
THIS.ADDITEM('Paul')
THIS.ADDITEM('Ona')
THIS.ADDITEM('George')
THIS.CONTROLSOURCE = THIS.PARENT.CONTROLSOURCE
ENDPROC
ENDDEFINE
DEFINE CLASS mycontainer AS CONTAINER
CONTROLSOURCE = ""
NAME = "mycontainer"
VISIBLE = .T.
ADD OBJECT text1 AS _textbox WITH ;
NAME = "Text1",;
selectonentry=.T.,;
enabled=.T.,;
VISIBLE = .T.
ADD OBJECT cmdFindCustomer AS COMMANDBUTTON WITH ;
LEFT = 100 , ;
WIDTH = 38, ;
VISIBLE = .T.
PROCEDURE INIT
THIS.text1.CONTROLSOURCE = THIS.PARENT.CONTROLSOURCE
ENDPROC
ENDDEFINE
DEFINE CLASS _textbox AS TEXTBOX
PROCEDURE Value_Assign(vNewVal)
THIS.VALUE = vNewVal
ENDPROC
ENDDEFINE
DEFINE CLASS mytextbox AS TEXTBOX
VISIBLE=.T.
ENDDEFINE
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only