Information générale
Catégorie:
Codage, syntaxe et commandes
>Hi Patric,
>
>With you soultion you add an editbox. It's default type is Character and there is no problem to add it.
>
>What I'm looking for is to add (no need to remove textbox first) a control to a column which has different default type like checkbox. F.ex.
>
>Create a DBF with two columns F1 C(10) and F2 C(10).
>Add one record to the DBF.
>Create new form
>Open Dataenvironment
>Add above DBF to the DE
>Drag DBF from the DE to the from -> grid is created
>Add a checkbox to the COLUMN number 2 (drag and drop)
>Run form to see that it is working
This is just a example, you can change it to checkbox
>
>Then add a checkbox programmatically to the column number one
>f.ex Forms init method (or in column1 init where ever you like)
>
>ThisForm.grdGriddbf1.Column1.ADDOBJECT("check1","checkbox")
>With ThisForm.grdGriddbf1.Column1.check1
> .Top = 35
> .Left = 5
> .Height = 10
> .Width = 10
> .Caption = "Check1"
> .ControlSource = ""
> .Name = "Check1"
> .Visible = .T.
>Endwith
>
>Problem is that checkbox is added but you get an error too:
>Error with Check1 - Value : Data type mismatch
ofcoz.....Character VS logical ????
>
>It doesn't help that you have defined .ControlSource = ""
>
>If you look columns / checkboxes in column1 and column2 you see that
>column2.controlsource is table.f1 and VFP added it without a problem
>(maybe because it is initialized before the column) but in this case both
>do the same - one with an error.
>
>
>AT
you can change the check1.controlsource
Précédent
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