Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A reference to the current column in a grid
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
A reference to the current column in a grid
Miscellaneous
Thread ID:
00147795
Message ID:
00147795
Views:
69
I need to get a reference to the current column in a grid, called from another object.

I'm using this in the click event of a command button that is beside the grid in the same form:

this.parent.myGrid.setfocus()
lnColumn=this.parent.myGrid.ActiveColumn
loColumn=this.parent.myGrid.columns[lnColumn]
*--Now I have a reference to the column

The problem is that if at runtime the user changes the column order by draging the column titles the above instructions won't do de job,
if I swap columns 2 and 3 set the focus to a cell in column that now is visible as the second one and then click in the command button
and do again:

this.parent.myGrid.setfocus()
lnColumn=this.parent.myGrid.ActiveColumn
*--lnColumn takes value of 2
loColumn=this.parent.myGrid.columns[lnColumn]

*--Now the problem is that loColumn now gets the reference to the 3rh column since myGrid.Columns[lnColumn] returns the reference to the 2nd created not to the 2nd visible.

Any hints?
Jorge Flores
From the Amigo Country
Next
Reply
Map
View

Click here to load this message in the networking platform