How to get the position of the selected column in XBrowse?
EMG
How to get the position of the selected column in XBrowse?
EMG
Look at this :
oBrw:nColSel
o:nCreationOrder
FOR i := 2 TO LEN( oBrw:aCols)
oCol := oBrw:aCols[ i ]
oCol:nEditType := EDIT_GET
oCol:bOnPostEdit := {|o, v, n| iif( (n != VK_ESCAPE .AND. oBrw:nColSel >2), (dbselectarea("EQUIP"),DBRLOCK(), FieldPut( o:nCreationOrder-1, v ), DBRUNLOCK() ), ) }
oCol:bLClickHeader := {|r,c,f,o| (DEXO(o:nCreationOrder),oBrw:refresh()) }
NEXT
Jack wrote:oBrw:nColSel
o:nCreationOrder
o:nAtcol(y)Marc Vanzegbroeck wrote:Do you mean
o:nAtcol(y)
Jack wrote:o:nCreationOrder
I spoke too fast. What I really need is to know the position of the currently selected column starting from the first column. nCreationOrder is a sort of column id. nPos is the position starting from the first visible column not from the first column.
Any help?
EMG
HI Enrico.
oCol: = oBrw: SelectedCol ()
It seem oCol: nCreationOrder () returns the correct position of a column only when the columns keep their original order of creation, but not when they are swapped or hidden.
I have checked the class and could not find the method or function you want.
Regards
Ok, thank you. I've checked the class myself and found nothing either. Let's wait for Rao final word.
EMG
Enrico Maria Giordano wrote:How to get the position of the selected column in XBrowse?
EMG
oSelectedCol := oBrw:SelectedCol()
nAt := AScan( oBrw:aCols, { |o| o:nCreationOrder == oSelectedCol:nCreationOrder } )nAt := oBrw:aDisplay[ oBrw:nColSel ]nageswaragunupudi wrote:But I am curious to know what is the use of this information in an application?
Enrico Maria Giordano wrote:I spoke too fast. What I really need is to know the position of the currently selected column starting from the first column. nCreationOrder is a sort of column id. nPos is the position starting from the first visible column not from the first column.
Any help?
EMG
Probably the question is academic now... I would want to know the physical position of the currently selected column starting from the first column of the browse, not from the first visible column.
EMG