mar. 18 septembre 2012, 17h03
news.atoutfox.org
atoutfox.public.association
Coincé dans un GRID
Bonjour,
J’ai une question à vous poser. Dans un formulaire j’inscris un GRID
dont le nombre de colonne est variable en fonction du nombre de jours du
mois.
Dans l’init de ce GRID, je décris toutes les propriétés dont j’ai besoin
et j’ajoute un CHECKBOX dans chaque cellule des colonnes 3 à n, n valant
nbjoursdumois+2
Ce que je ne sais pas faire c’est comment et où rédiger la procédure qui
doit être lancée à chaque click sur les CHECKBOX du GRID car en règle
générale je fais un clic droit pour faire apparaître les propriétés et
méthodes de l’objet que je sélectionne, or dans mon cas cet objet
n’existe qu’à l’exécution.
Merci pourvos lumières
Voici ma procédure INIT du GRID
<\VFP>
*
With This
.DeleteMark=.F.
.GridLineColor=RGB(0,0,0)
.RecordMark=.F.
.RecordSourceType=1
.RecordSource="TEMP"
.ColumnCount=ca_nbj+1+1
.ScrollBars=3
.LockColumns=2
.HighlightStyle= 2
.HighlightBackColor=RGB(208,253,206)
.HighlightForeColor = RGB(255,0,0)
.HighlightRowLineWidth=2
.AllowCellSelection=.T.
ENDWITH
*
with this.Column1
.ControlSource='TEMP.NOM_PRéNOM'
.Width=260
.ReadOnly=.T.
.Enabled=.T.
.FontName="Tahoma"
.Fontsize=9
.Header1.Caption="Nom"
.Header1.Alignment=2
.Header1.Fontname="Tahoma"
.Text1.TabStop=.F.
.Header1.Forecolor = RGB(255,0,0)
.Header1.FontBold=.T.
.Resizable=.F.
.Movable=.F.
endwith
*
with this.Column2
.ControlSource='TEMP.NUM'
.Width=55
.ReadOnly=.T.
.Enabled=.T.
.FontName="Tahoma"
.Fontsize=9
.Header1.Caption="Chambre"
.Header1.Alignment=2
.Header1.Fontname="Tahoma"
.Text1.TabStop=.F.
.Resizable=.F.
.Movable=.F.
.Text1.alignment=2
endwith
*
FOR i=1 TO ca_nbj
mcol="Column"+ALLTRIM(STR(i+1+1))
IF ca_midisoir=1
IF i<10
mccs="TEMP.J0"+ALLTRIM(STR(i))
ELSE
mccs="TEMP.J"+ALLTRIM(STR(i))
ENDIF
ELSE
IF i<10
mccs="TEMP.A0"+ALLTRIM(STR(i))
ELSE
mccs="TEMP.A"+ALLTRIM(STR(i))
ENDIF
ENDIF
*
WITH this.&mcol
IF i=ca_nday
.Width=32
ELSE
.Width=20
ENDIF
.Controlsource=(Mccs)
.FontName="Tahoma"
.Fontsize=8
.Resizable=.F.
.Movable=.F.
*.BackColor=(mcolor2)
.Header1.Alignment=2
.Header1.Fontname="Tahoma"
IF i<10
.Header1.Caption="0"+ALLTRIM(STR(i))
ELSE
.Header1.Caption=ALLTRIM(STR(i))
ENDIF
*
IF i = ca_nday
.Header1.FontBold=.T.
ENDIF
*
.RemoveObject("Text1")
*
.Addobject("Check1","CHECKBOX")
.Check1.caption=""
.Check1.AutoSize=.T.
.Check1.FontName="Tahoma"
.Check1.Alignment=0
.Check1.Backstyle=0
.Check1.Style=0
.Check1.SpecialEffect=0
.Check1.TabIndex=2
.Check1.Visible=.T.
*
IF I=ca_nday
.Check1.PicturePosition=13
.Check1.Alignment=2
.Check1.Enabled=.T.
.Check1.ReadOnly=.F.
.Check1.Tabstop=.T.
ELSE
.Check1.PicturePosition=13
.Check1.Alignment=2
.Check1.Enabled=.F.
.Check1.ReadOnly=.T.
.Check1.Tabstop=.F.
ENDIF
*
.sparse=.F.
.Bound=.T.
endwith
ENDFOR
*
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000009727