Page 1 of 1

GRID : Bug in refresh ?

Posted: Fri May 20, 2016 8:55 pm
by TopsMarc
Hi,

In my program ART there is a MSGDEBUG(...) in the function ART_NewArtID(). I compile and run the program.
I click in the GRID. Remember the record.
Click button ADD, click button REFRESH.
The current record in the GRID is the same as before I clicked the buttons.

Now I remove the MSGDEBUG(...) in program ART, compile and run the program again. I repeat the same actions.
I click in the GRID. Remember the record.
Click button ADD, click button REFRESH.
The current record in the GRID is NOT the same as before I clicked the buttons.
How is that possible ? Is there a bug in the GRID refresh ? Why is the GRID result incorrect without the MSGDEBUG(...) in the program ?
I don't get it.

You can see it too in the movie GridRefresh in attachment.

(Any remarks about the program, good or bad, are welcome too. I want to learn).

Kind regards, Marc

Re: GRID : Bug in refresh ?

Posted: Fri May 20, 2016 10:48 pm
by srvet_claudio
Hi Marc,
see this changes:

Code: Select all

*------------------------------------------------------------------------------*
FUNCTION ART_RefreshScreen()
*------------------------------------------------------------------------------*
	LOCAL nRecno := Win_ART_GRID.Grid_ART.RecNo    // ART->(recno())

   msgdebug(Win_ART_GRID.Grid_ART.RecNo,  ART->(recno()), nRecno_ART)

	Win_ART_GRID.Grid_ART.Refresh 
	Win_ART_GRID.Grid_ART.RecNo := nRecno
	Win_ART_GRID.Grid_ART.Setfocus
	ART_RefreshData()
RETURN

Re: GRID : Bug in refresh ?

Posted: Sat May 21, 2016 6:29 am
by TopsMarc
Hi Claudio,

Your MSGDEBUG helps me to prove there is something weird.

Let us do your changes, but also keep my MSGDEBUG in the function ART_NewArtID, compile and run.
Click on a record in the grid, click the add button, click the refresh button.
Your MSGDEBUG in function ART_Refreshscreen will show that Win_ART_Grid.Grid_ART.RecNo and nRecno_ART and ART->(recno()) are the same, as it should be.

Now keep your MSGDEBUG, but remove my MSGDEBUG in the function ART_NewArtID, compile and run again.
Click on a record in the grid, click the add button, click the refresh button.
Your MSGDEBUG in ART_Refreshscreen will show that ART->(recno()) is NOT the same anymore as Win_ART_Grid.Grid_ART.RecNo and nRecno_ART.
Why is that ? That is illogically, isn't it ? Therefore I think it is a bug.

Kind regards, Marc