Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to assing method to a grid's column
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00526757
Message ID:
00527448
Views:
39
Thierry:
You can use a grid cover class to fix the problem.
I took this from FoxPro Advisor and worked very well.

Create a class based on SHAPE base class.

Add it a property called cTargetGrid wich will hold the name of your grid.


In the INIT event put the following code:
Local lcTargetGrid, loTargetGrid
lcTargetGrid = This.cTargetGrid
loTargetGrid = Eval( "ThisForm." + lcTargetGrid )
This.Top = loTargetGrid.Top + loTargetGrid.HeaderHeight
This.Left = loTargetGrid.Left + 10
This.Width = loTargetGrid.Width - 27
This.Height = loTargetGrid.Height - loTargetGrid.HeaderHeight
This.ZOrder(0)

In the CLICK event:
Local Array laClick[1]
AMouseObj( laClick,1 )
Local lnGridComponent, ;
lnRelativeRow, ;
lnRelativeColumn ,;
loTargetGrid ,;
lcJunk

lcTargetGrid = This.cTargetGrid
loTargetGrid = Eval( "ThisForm." + lcTargetGrid )
loTargetGrid.SetFocus()
lInGrid = loTargetGrid.GridHitTest( laClick[3], laClick[4], @lnGridComponent, @lnRelativeRow, @lnRelativeColumn )
Release laClick

If lnGridComponent == 3
loTargetGrid.ActivateCell( lnRelativeRow, lnRelativeColumn )
EndIf


In the form containing your grid, drop this new class and set the cTargetGrid property with the name of your grid.
Run the form

Hope this help
Germán Turriziani
Marcos Juarez - Córdoba - Argentina
gturriziani@tutopia.com
gturriziani@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform