He armado este ejemplo con un rowset pero con la clausula AUTOSORT y no ordena las columnas, solo al colocar // XbrSetupBar( oBrw ) vueve a ordernar, podria verificar si es asi o estoy haciendo algo mal ?
Muchas gracias.
Code: Select all | Expand
#include "fivewin.ch"
static aStr := { "208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950", ;
"209.250.245.152,fwh,fwhuser,FiveTech@2022" }
static oCn
//----------------------------------------------------------------------------//
function Main()
local oDlg, oFont, oBrw
local oRs, cSql
FWSetLanguage( 1 )
FW_SetUnicode( .t. )
if ( oCn := maria_Connect( aStr[ 1 ], .t. ) ) = nil
Return NIL
EndIf
TEXT INTO cSql
SELECT C.ID AS CustID, C.FIRST AS CustName, C.AGE AS AG, C.STATE AS ST, S.NAME AS StateName
FROM customer C
LEFT OUTER JOIN states S ON C.STATE = S.CODE
ORDER BY CUSTID
ENDTEXT
oRs := oCn:RowSet( cSql )
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE DIALOG oDlg SIZE 600,470 PIXEL TRUEPIXEL RESIZABLE FONT oFont ;
TITLE "XBROWSE : BUILT-IN BUTTON BAR"
@ 20,20 XBROWSE oBrw SIZE -20,400 PIXEL OF oDlg ;
DATASOURCE oRs AUTOSORT AUTOCOLS CELL LINES NOBORDER
XbrSetupBar( oBrw ) // Si lo anulo, funciona el AUTOSORT
WITH OBJECT oBrw
:nEditTypes := EDIT_GET
:SetChecks()
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil
function XbrSetupBar( oBrw )
oBrw:nTopBarHeight := 30
oBrw:bOnAdjust := <||
local oBtn
@ 05,05 BTNBMP oBtn FILE "..\bitmaps\16X16\new.bmp" SIZE 30,20 PIXEL OF oBrw NOBORDER ;
ACTION oBrw:EditSource( .t. ) TOOLTIP "Add New Record"
@ 05,45 BTNBMP oBtn FILE "..\bitmaps\edit.bmp" SIZE 30,20 PIXEL OF oBrw NOBORDER ;
ACTION oBrw:EditSource() TOOLTIP "Edit this record"
@ 05,85 BTNBMP oBtn FILE "..\bitmaps\16x16\delete.bmp" SIZE 30,20 PIXEL OF oBrw NOBORDER ;
ACTION If( MsgNoYes( "Delete this row?" ),,oBrw:Delete() ) TOOLTIP "Delete This Record"
return nil
>
return nil