xbrowse SelectRow method

xbrowse SelectRow method

Postby Silvio.Falconi » Sat Mar 30, 2024 3: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7070
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse SelectRow method

Postby nageswaragunupudi » Sun Mar 31, 2024 5:19 am

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

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

Re: xbrowse SelectRow method

Postby nageswaragunupudi » Sun Mar 31, 2024 5:22 am

Or, if we want to deselect a specific row number, which is not the current row, we can do like this.
Code: Select all  Expand view  RUN
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
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xbrowse SelectRow method

Postby Silvio.Falconi » 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: Select all  Expand view  RUN
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: Select all  Expand view  RUN
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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7070
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 49 guests