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