I found some problem using grid with array table. Sometimes I found blank records coming in the grid. But this works fine when using old BROWSE control.
I don't have a small sample right now. So I am giving my codes where I found problems.
Code: Select all
#include <hmg.ch>
Function dbf_menu(mAlias, aHeader, aWidth, aFieldnm, abDynamicDisplay, aJustify)
local mOldRecno, lRecChanged := .f.
mOldRecno := if((mAlias)->(eof()), 0, (mAlias)->(recno()))
DEFINE WINDOW frmDbf_menu ;
AT 0,0 ;
WIDTH 640 ;
HEIGHT 480 ;
TITLE 'Find' ;
MODAL
@ 10,10 GRID Grid_1 ;
WIDTH 610 ;
HEIGHT 380 ;
HEADERS aHeader ;
WIDTHS aWidth;
ROWSOURCE mAlias ;
COLUMNFIELDS aFieldNm ;
DYNAMICDISPLAY abDynamicDisplay ;
JUSTIFY aJustify ;
value {(mAlias)->(recno()), 1}
@ 400, 150 button cmdOk caption "&Ok" action {|| lRecChanged := .t., frmDbf_menu.release()}
@ 400, 390 button cmdCancel caption "&Cancel" action frmDbf_menu.release()
END WINDOW
on key ESCAPE of frmDbf_menu action frmDbf_menu.release()
CENTER WINDOW frmDbf_menu
ACTIVATE WINDOW frmDbf_menu
if !lRecChanged
if mOldRecno > 0
(mAlias)->(dbgoto(mOldRecno))
endif
endif
Return
Code: Select all
Static Function FindSale()
dbf_menu("tempsale", {"Inv Dt", "Inv No", "Amount"}, {100, 100, 100}, {"invdt", "invno", "netamt"}, ;
{{|| this.cellvalue}, {|| this.cellvalue}, {|| transform(this.cellvalue, '99,99,99,999.99')}},;
{0, 0, 1})
thiswindow.setfocus()
RefreshData()
return nilThanks in advance.
With best reagrds.
Sudip