FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xbrowse SelectRow method
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
xbrowse SelectRow method
Posted: Sat Mar 30, 2024 03:46 PM

If I made to select all record on xbrowse

oBrw:SelectRow( 4 )

and the I wish deselect only one record

If I made oBrw:SelectRow( 0 ) it deselect all

how resolve ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xbrowse SelectRow method
Posted: Sun Mar 31, 2024 05:19 AM

oBrw:SelectRow( 2 ) toggles selection of the current row in focus.

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xbrowse SelectRow method
Posted: Sun Mar 31, 2024 05:22 AM
Or, if we want to deselect a specific row number, which is not the current row, we can do like this.
Code (fw): Select all Collapse
if ( nAt := AScan( oBrw:aSelected, nRecNo ) ) > 0
HB_ADel( oBrw:aSelected, nAt, .t. )
endif
oBrw:Refresh()
We do not recommend this, but this is possible.
Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: xbrowse SelectRow method
Posted: Mon Apr 01, 2024 10:55 PM
nageswaragunupudi wrote:Or, if we want to deselect a specific row number, which is not the current row, we can do like this.
Code (fw): Select all Collapse
if ( nAt := AScan( oBrw:aSelected, nRecNo ) ) > 0
HB_ADel( oBrw:aSelected, nAt, .t. )
endif
oBrw:Refresh()
We do not recommend this, but this is possible.
Nages,

using this function
Code (fw): Select all Collapse
Function DeSelect_One(oBrw,oDbf)
   local  nRecNo:=oDbf:recno(),nAt
   if ( nAt := AScan( oBrw:aSelected, nRecNo ) ) > 0
        HB_ADel( oBrw:aSelected, nAt, .t. )
    endif
    oBrw:Refresh()
 return nil
It seem run ok

if I select two or three records and deselect one, the menu in the buttonbar remains unchanged because I added an if control

IiF(LEN(oBrw:aSelected)==0,Btnbar(1,.....)

thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion