FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Twbrowse .. hide a listbox column
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Twbrowse .. hide a listbox column
Posted: Mon Dec 17, 2007 02:45 PM

To All

I have a routine that goes out and creates a database structure that is a variable number of fields .. I use the generic code :

REDEFINE LISTBOX oBrow FIELDS ;
ID 111 of oEMP

to view the data .. I do know that I want to HIDE the first column .. is that possible with Twbrowse or with Hernan's Twbrowse ??

Thanks
Rick Lipkin

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Twbrowse .. hide a listbox column
Posted: Mon Dec 17, 2007 03:03 PM
With xBrowse it is possible

oBrw  := TXBrowse():New( oDlg )
oBrw:SetRDD( .T. )   .or. oBrw:SetADO( oRs )
oBrw:CreateFromResource( nID )
oBrw:aCols[1]:Hide()
ACTIVATE DIALOG oDlg
Regards



G. N. Rao.

Hyderabad, India
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Twbrowse .. hide a listbox column
Posted: Mon Dec 17, 2007 03:04 PM
Rick,

DATA bLine is a codeblock that returns an array with the columns data to display. You may call a function and the function will return the desired columns:
oBrw:bLine = { || GetColumns( lHideFirst ) }

function GetColumns( lHideFirst )

   if lHideFirst
      return { FieldGet( 2 ), FieldGet( 3 ), FieldGet( 4 ) }
   else
      return { FieldGet( 1 ), FieldGet( 2 ), FieldGet( 3 ), FieldGet( 4 ) }
   endif

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Twbrowse .. hide a listbox column
Posted: Mon Dec 17, 2007 04:54 PM

Thanks .. appreciate the answers ..

Rick

Continue the discussion