XBROWSE activate or deactivate AUTOSORT

XBROWSE activate or deactivate AUTOSORT

Postby avista » Wed Feb 08, 2012 10:50 pm

Hi all,
I want to have unsorted XBROWSE in start and after that is it possible to activate or deactivate AUTOSORT

Something like:
oBrw:lAutoSort := .t. ; oBrw:Refresh()
or
oBrw:lAutoSort := .f. ; oBrw:Refresh()

Best Regards,
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: XBROWSE activate or deactivate AUTOSORT

Postby nageswaragunupudi » Wed Feb 08, 2012 11:18 pm

To DeActivate Autosort:
Code: Select all  Expand view

aSaveSort := oBrw:cSortOrders  // aSaveSort is a static variable
oBrw:cSortOrders := nil
 

To Reactivate
Code: Select all  Expand view
oBrw:cSortOrders := aSaveSort
Regards

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

Re: XBROWSE activate or deactivate AUTOSORT

Postby avista » Fri Feb 10, 2012 1:32 am

Going good,
Thanks,
Just one more question,
Is it possible if remove autosort to return UNSORTED xbrowse and remove (ascending-descending) sort pointer on header ?

Best regards,
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: XBROWSE activate or deactivate AUTOSORT

Postby nageswaragunupudi » Fri Feb 10, 2012 3:32 am

avista wrote:Going good,
Thanks,
Just one more question,
Is it possible if remove autosort to return UNSORTED xbrowse and remove (ascending-descending) sort pointer on header ?

Best regards,

No.
1) To remove ascend/descend buttons on header, please also include these lines:
Code: Select all  Expand view
oBrw:cSorts := ""
oBrw:Refresh()

2) XBrowse, by itself, can not restore natural order. We need to do it manually inside the above code.
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 90 guests