for a sample I made:
oApp():oGrid := TXBrowse():New( oApp():oDlg )
.. columns...
oApp():oGrid:SetRDD()
oApp():oGrid:CreateFromCode()
oApp():oGrid:aCols[9]:lhide:=.t.
and it run at init
then if I use the popup menu at columns
and I wish show the nineth column it show the column "Annotazione esercizio"
but when I press DEFAULT COLUMNS I wish return to state init ( with the oApp():oGrid:aCols[9]:lhide:=.t.)
or if the user select the oApp():oGrid:aCols[9] on menupopup it must be showed
the setcolumns method of xbrowse
- Code: Select all Expand view
- METHOD SetColumns( nRow, nCol, nFlags ) CLASS TXBrowse
local oMenu, oCol
local nFor, nLen
nLen := Len( ::aCols )
MENU oMenu POPUP
if ::l2007
if WndMain() != nil .and. WndMain():oMenu != nil .and. WndMain():oMenu:l2010
oMenu:l2010 := .t.
else
oMenu:l2007 := .t.
endif
endif
Menuitem "Default Columns" ACTION ( ;
ASort( ::aCols, nil, nil, { |x,y| x:nCreationOrder < y:nCreationorder } ), ;
AEval( ::aCols, { |o| o:lHide := .f. } ), ;
::GetDisplayCols(), ;
::Refresh() )
separator
for nFor := 1 to nLen
oCol := ::aCols[ nFor ]
MenuAddItem( oCol:cHeader, , !oCol:lHide, ;
( Len(::aDisplay) != 1 .or. ocol:nPos != 1 ), ;
GenMenuBlock( ::aCols, nFor ) )
next
ENDMENU
ACTIVATE POPUP oMenu AT nRow, nCol OF Self
return nil
the command
Menuitem "Default Columns" ACTION ( ;
ASort( ::aCols, nil, nil, { |x,y| x:nCreationOrder < y:nCreationorder } ), ;
AEval( ::aCols, { |o| o:lHide := .f. } ), ;
::GetDisplayCols(), ;
::Refresh() )
show all columns and not that columns I set at init