Twbrowse .. hide a listbox column

Post Reply
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Twbrowse .. hide a listbox column

Post by Rick Lipkin »

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
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

With xBrowse it is possible

Code: Select all

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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:

Code: Select all

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
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Post by Rick Lipkin »

Thanks .. appreciate the answers ..

Rick
Post Reply