Jean Peter Paredes


ok !
I have a form with a pageframe and two pages. i have a grid on page 1 for sales_items. i have two MySql tables 'sales' and 'sales_items'. i have set the allowaddnew property of the grid to .T. . try to add a new record to the grid and save it (it works fine) now on the grid press the down arrow more than 4 times so that it will look like ur adding more than 4 new records, and then run the update on both tables and walah ! the grid loses its data, but if you browse the table using a button or something, you will see that the data is actually still there but the grid wont show it. here is a sample of how i requery my child table. Please read the notes with a NOTE marker


ThisForm.pageframe1.page1.Grid1.RecordSource=""

NOTE the problem starts here, after the grid1 recordsource is set to "" after this, grid hides the content
NOTE the grid is set to "" before requerying the sales_items table to retain the actuall layout of the grid

lcSQLStmt="Select * from sales_items where TRIM(s_ctrl)='"+ALLTRIM(sales.s_ctrl)+"'"
=sqlexec(lnHandle,lcSQLStmt,"sales_items")
IF !make_updatable("sales_items","si_uid","sales_items","",.F.)
=MESSAGEBOX("sales_items",0,"c")
ENDIF

with ThisForm.pageframe1.page1.Grid1
.RecordSource="sales_items"
NOTE here we set the recordsource back, u can even place a messagebox here to see if the grid recordsource
NOTE has been updated (it is updated) but the grid doesnt show anything
.columns(1).controlsource="sales_items.is_code"
.columns(2).controlsource="sales_items.is_Ctrl"
.columns(2).combo1.requery()
.columns(3).controlsource="sales_items.emp_Ctrl"
.columns(3).mycombobox1.requery()
.columns(4).controlsource="sales_items.si_qty"
.columns(5).controlsource="sales_items.si_price"
.columns(6).controlsource="sales_items.si_amount"
.columns(7).controlsource="sales_items.si_discount"
.Refresh
ENDWITH


what is weird is that from my button "ADD" "EDIT "SAVE" "CANCEL" ,after the grid shows no sign of life Smile and i press SAVE (still nothing) , and then press ADD and CANCEL the grid shows its contents back Smile , but i cant keep on simulating the ADD CANCEL buttons everytime i execute the SAVE button , this could decrease the performance of my applications especially if im using Large Tables. NEED HELP PLSSS any1 T_T




Re: Visual Foxpro Grid is hiding something from me :(

Carl Warner


Between these two MS KB articles, you can figure out why it's happening and how to solve it so it doesn't happen again.

A cursor-based grid is blank if the SELECT-SQL command resets the cursor in Visual FoxPro
http://support.microsoft.com/default.aspx scid=kb;en-us;140653


PRB: Grid Column's CurrentControl Reverts to Text1 Default
http://support.microsoft.com/default.aspx scid=kb;en-us;132478






Re: Visual Foxpro Grid is hiding something from me :(

Jean Peter Paredes

Yo thanks man. that was really helpfull... and it ddnt decrease the performance of my form since when im creating a dummy cursor for the recordsource , i select .F. . thanks a lot






Re: Visual Foxpro Grid is hiding something from me :(

Jean Peter Paredes

I got another problem, i have built an application for my project lets name it myproj.exe for example

when i dbl click on myproj.exe there is this foxpro windows that pops up first then it disappears and my small form in the project appears, how can i disallow that foxpro window from showing especially when the computer is slow , that foxpro window is getting obvious.. help plss

HIDE WINDOW etc doesnt seem to work , applications.visible doesnt work either





Re: Visual Foxpro Grid is hiding something from me :(

Carl Warner

How To Hide Desktop in Run-Time (.exe) VFP5 Application
http://support.microsoft.com/kb/156088/en-us