Information générale
Catégorie:
Programmation Orientée Object
I've been working on a form that will allow users add/edit their setup tables. To do this, I've been working with the grid control.
When this form gets invoked, all the properties of the grid control need to be set within the Init method. There seems to be no problem setting any properties for the grid itself, the columns, or the headers, but when I try to set the property for text control within the column, I get the following error message:
"Parent object will not allow this property setting for
form1.grid1.column1.text1.ControlSource"
And this is the code that I have placed in the Init() to set
properties of the form and the grid control:
INIT METHOD
slcTable = ALLTRIM(tmpLookup.Name)
IF !USED(slcTable)
USE slcTable IN 0 EXCLUSIVE
ENDIF
ThisForm.Height = VAL(tmpLookup.Form_hght)
ThisForm.Width = VAL(tmpLookup.Form_wdth)
ThisForm.Top = VAL(tmpLookup.Form_top)
ThisForm.Left = VAL(tmpLookup.Form_left)
ThisForm.Grid1.Height = VAL(tmpLookup.Grid_hght)
ThisForm.Grid1.Width = VAL(tmpLookup.Grid_wdth)
ThisForm.Grid1.Top = VAL(tmpLookup.Grid_top)
ThisForm.Grid1.Left = VAL(tmpLookup.Grid_left)
ThisForm.Grid1.ColumnCount = VAL(tmpLookup.Grid_clcnt)
ThisForm.Grid1.RecordSource = ALLTRIM(tmpLookup.Grid_recs)
ThisForm.Grid1.RecordSourceType = VAL(tmpLookup.Grid_recst)
ThisForm.Grid1.Column1.ControlSource = ALLTRIM(tmpLookup.Col1_cnts)
ThisForm.Grid1.Column1.Width = VAL(tmpLookup.Col1_width)
ThisForm.Grid1.Column1.Header1.Caption = ALLTRIM(tmpLookup.Head1_cap)
ThisForm.Grid1.Column1.Text1.ControlSource = ALLTRIM(tmpLookup.Text1_cnts)
ThisForm.Grid1.Column2.ControlSource = ALLTRIM(tmpLookup.Col2_cnts)
ThisForm.Grid1.Column2.Width = VAL(tmpLookup.Col2_width)
ThisForm.Grid1.Column2.Header1.Caption = ALLTRIM(tmpLookup.Head2_cap)
*!* ThisForm.Grid1.Column2.Text1.ControlSource = ALLTRIM(tmpLookup.Text2_cnts)
ThisForm.Grid1.Column3.ControlSource = ALLTRIM(tmpLookup.Col3_cnts)
ThisForm.Grid1.Column3.Width = VAL(tmpLookup.Col3_width)
ThisForm.Grid1.Column3.Header1.Caption = ALLTRIM(tmpLookup.Head3_cap)
*!* ThisForm.Grid1.Column3.Text1.ControlSource = ALLTRIM(tmpLookup.Text3_cnts)
I don't know if this is a limitation of FoxPro, or something that I am missing along the way.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement