Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to return a row cursor from grid on mouse click
Message
From
13/04/2004 17:06:29
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00894539
Message ID:
00894602
Views:
7
Hi Austin.

Well My Grid is Showing data from an SQL Statement. However, I want to access the ActiveRow whenever I click on a specific cell. Currently, Grid control only fire the Click() event whenever I click anywhere inside that grid that doesn't contain data.

There are a couple of ways that you can address this issue. In VFP version 8 you can use code like this in the grid's Init() to fire the grid's click whenever you click on a cell that contains data:
*** now make sure that the click method of all the contained text boxes
*** delegate to the grid's click()
FOR EACH loColumn IN This.Columns 
  FOR EACH loControl IN loColumn.Controls
    IF LOWER( loControl.BaseClass ) = 'textbox'
      BINDEVENT( loControl, 'Click', This, 'Click' )
    ENDIF
  ENDFOR
ENDFOR
In earlier versions, you can create a custom textbox class that has this code in its click() method and replace the native textbox in the grid with your custom text box class:
This.Parent.Parent.Click()
Previous
Reply
Map
View

Click here to load this message in the networking platform