Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DoubleClick on Grid
Message
From
10/06/2008 06:40:43
 
 
To
09/06/2008 20:44:53
Ransome So
Ransome's Workshop
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01322710
Message ID:
01322774
Views:
12
In VFP 6, I can doubleclick on a grid row to have further action. However, I fail to do that at VFP 9. Have I forgetton something to set?

In VFP 6, you needed a special textbox sub-class to put in each grid column that had code like this in its DblClick():
This.Parent.Parent.dblClick()
This still works in VFP 9, but in VFP 9, there are other ways to accomplish this. One way is to set the grid's AllowCellSelection property to .F. because then, when you double click on the grid, it is the grid's DblClick() that fires and not the contained control's. If you need to AllowCellSelection, then this code in the grid's Init() will allow the dblClick of the contained controls to fire the grid's DblClick():
FOR lnCol = 1 TO This.ColumnCount
  loColumn = This.Columns[ lnCol ]
  FOR EACH loControl IN loColumn.Controls
      IF PEMSTATUS( loControl, [dblClick], 5 )      
        BINDEVENT( loControl, 'dblClick', This, 'dblClick' )  
      ENDIF
      IF PEMSTATUS( loControl, [Click], 5 )      
        BINDEVENT( loControl, 'Click', This, 'Click' )  
      ENDIF
    ENDIF
  ENDFOR
ENDFOR
Previous
Reply
Map
View

Click here to load this message in the networking platform