Twbrowse .. hide a listbox column

Twbrowse .. hide a listbox column

Postby Rick Lipkin » Mon Dec 17, 2007 2: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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby nageswaragunupudi » Mon Dec 17, 2007 3:03 pm

With xBrowse it is possible

Code: Select all  Expand view
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
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Antonio Linares » Mon Dec 17, 2007 3: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:
Code: Select all  Expand view
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
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Rick Lipkin » Mon Dec 17, 2007 4:54 pm

Thanks .. appreciate the answers ..

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 83 guests