TXBROWSE LINE NUMBER?

TXBROWSE LINE NUMBER?

Postby Horizon » Fri Nov 13, 2009 3:40 pm

Hi,

How can I add a line number column in TXBrowse. (Not. recno())

Thanks,
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: TXBROWSE LINE NUMBER?

Postby ukoenig » Fri Nov 13, 2009 5:00 pm

Hello Hakan,
You can add a Column to get Row-Numbers like :

oCol := oLbx:AddCol()
oCol:cHeader := "No."
oCol:bStrData := { || (1)->(ORDKEYNO()) }
oCol:nWidth := 60

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: TXBROWSE LINE NUMBER?

Postby nageswaragunupudi » Fri Nov 13, 2009 5:34 pm

The above example works only for DBFs.

The example given below works for XBrowse of any data ( DBF, ADO, TDataBase, Array or any object being browsed )
Code: Select all  Expand view
  ADD TO oBrw AT 1 DATA oBrw:KeyNo() HEADER 'No' PICTURE '9999'


If you prefer the OOPs way of coding
Code: Select all  Expand view
  WITH OBJECT oBrw:InsCol( 1 )
      :bEditValue    := { || oBrw:KeyNo() }
      :cEditPicture  := '9999'
      :cHeader       := 'LineNo'
   END
 

FWH documentation advises not to use :bStrData directly ( though it works for reasons of backward compatibility). Preferred way is to assign the :bEditValue and assign picture if needed to cEditPicture.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: TXBROWSE LINE NUMBER?

Postby Horizon » Fri Nov 13, 2009 9:07 pm

Thanks Uwe, nageswaragunupudi

It works fine.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 102 guests