I have tried to use CheckBox in XBROWSE and its working checks and un-checks BUT it is NOT working for SelectAll method.
The Code is given below. Could you please guide me
- Code: Select all Expand view RUN
#include "fivewin.ch"
function Main
local oDlg, oBrw, aData
local oCn := FW_DemoDB( 1 )
local oRs
oRs := oCn:RowSet( "select * from clients" )
DEFINE DIALOG oDlg SIZE 400,400 PIXEL TRUEPIXEL
@ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
DATASOURCE oRs ;
COLUMNS "Code", "First", "Last" ;
LINES NOBORDER
WITH OBJECT oBrw:InsCol( 1 )
:cHeader := " "
:bEditValue := { || If( AScan( oBrw:aSelected, oBrw:BookMark ) > 0, .t., nil ) }
:SetCheck()
:nHeadBmpNo := { || If( Len( oBrw:aSelected ) == oBrw:nLen, 1, 2 ) }
:bLClickHeader := < |r,c,f,oCol|
If Len( oBrw:aSelected ) == oBrw:nLen
oBrw:SelectNone()
else
oBrw:SelectAll()
?"Select All"
endif
return nil
>
END
WITH OBJECT oBrw
:nMarqueeStyle := MARQSTYLE_HIGHLROW
:lMultiSelect := .f.
:bClrSelFocus := { || { CLR_BLACK, CLR_HGRAY } }
:nStretchCol := 3
:aCols[ 1 ]:bClrSelFocus := { ||{ CLR_BLACK, CLR_WHITE } }
:bLClicked := { |r,c,f,oBrw| If( oBrw:MouseColPos( c ) == 1 , ;
If( ( f := AScan( oBrw:aSelected, oBrw:BookMark ) ) == 0, ;
AAdd( oBrw:aSelected, oBrw:BookMark ), ;
ADel( oBrw:aSelected, f, .t. ) ), nil ), ;
oBrw:RefreshCurrent() }
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
return nil
Thanks
Shridhar