FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse - change columns dynamically
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
xBrowse - change columns dynamically
Posted: Thu Mar 10, 2011 09:02 PM

How can I change change columns dynamically in xBrowse

Thanks in advance
Otto

Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM
Re: xBrowse - change columns dynamically
Posted: Sat Mar 12, 2011 06:45 PM

Otto:

Can you elaborate about what you want to do?

Randal

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: xBrowse - change columns dynamically
Posted: Sat Mar 12, 2011 08:22 PM
Hello Randal,

I would like to change between these 2 views:




Thanks in advance
Otto
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: xBrowse - change columns dynamically
Posted: Sun Mar 13, 2011 02:21 AM

Otto,

The simplest thing to do is just define two browses both using the same DBF but opened twice. Then you can hide() one and show() the other. Since you have the DBF open in two workareas you don't have to worry about pointers, filters, sort orders, etc.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: xBrowse - change columns dynamically
Posted: Sun Mar 13, 2011 03:16 AM

Otto

Other option is show or hide column

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse - change columns dynamically
Posted: Thu Mar 17, 2011 02:33 PM

Mr. Otto

As Mr. Daniel advised Hide and show columns is one simple way if the change is simple.

Another way to dynamically change the view is by using the method ReArrangeCols( aCols, lRetainRest )

To show 'First', 'Last', 'City'
oBrw:ReArrangeCols( { "First", "Last", "City" }, .t. )
To switch to show 'First', 'Age', 'HireDate'
oBrw:ReArrangecols( { "First", "Age", "HireDate" }, .t. )

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion