Hi Jaime,
You can implement BINDTOEVENTS() in your grid class.
PROCEDURE Bind_RightClick()
LOCAL lii,liy,loCol,loObj
FOR lii=1 TO m.This.ColumnCount
loCol=m.This.Columns(m.lii)
FOR liy=1 TO m.loCol.ControlCount
loObj=m.loCol.Columns(m.liy)
=BINDEVENTS(m.loObj,"RightClick",m.This,"RightClick",1)
NEXT
NEXT
PROCEDURE Destroy()
LOCAL lii,liy,loCol,loObj
FOR lii=1 TO m.This.ColumnCount
loCol=m.This.Columns(m.lii)
FOR liy=1 TO m.loCol.ControlCount
loObj=m.loCol.Columns(m.liy)
=UNBINDEVENTS(m.loObj,"RightClick",m.This,"RightClick")
NEXT
NEXT
MartinJ
>Hi Martin
>Thanks for your help.
>I thought of BindEvents(), but is there an easy way to accomplish what i want, with BindEvents(), without having to enter some code in every column/textbox? The reason i ask is that i have a grid with some 40+ columns...
>Jaime
>
>>Hi Jaime,
>>
>>Under VFP 5.0/6.0/7.0 you can use command ON KEY LABEL RIGHTMOUSE... or create grid programmaticaly with own classes for column and controls for columns. Under VFP 8.0 you can use BINDEVENTS() for bindings method on objectes.
>>
>>MartinJ
>>
>>>Hi All
>>>I have a popup menu attached to the Right-Click event of a grid. Since the events that fire are in the textboxes inside the grid columns, i added in every textbox's right-click event : This.Parent.Parent.RightClick().
>>>Is there a more elegant way to achieve this? I am using VFP8 SP1
>>>
>>>Thanks
>>>Jaime