Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting a cell value from a grid
Message
From
09/04/2004 09:48:32
 
 
To
09/04/2004 09:17:27
Paul Trimming
Lonely Pilgrim Shareware
Merstham, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00893521
Message ID:
00893529
Views:
28
This message has been marked as the solution to the initial question of the thread.
Hello Paul.

I want to find out the value of the selected cell in a grid programmatically, and I can't find how to do it.

The grid only has an active (selected) cell when the grid has focus. You can refer to This.Value in the selected cell. Or from elsewhere in the grid, you can use code like this:
*** Find out which column is the active column
WITH This
  FOR EACH loColumn IN .Columns
    IF loColumn.ColumnOrder = .ActiveColumn
      luValue = EVAL( loColumn.ControlSource )
      EXIT
    ENDIF
  ENDFOR
ENDWITH
To access the data in the grid, you can just refere to its underlying RecordSOurce using Alias.Field.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform