GRID : problem with delete and refresh

Moderator: Rathinagiri

User avatar
apais
Posts: 440
Joined: Fri Aug 01, 2008 6:03 pm
DBs Used: DBF
Location: uruguay
Contact:

Re: GRID : problem with delete and refresh

Post by apais »

I hope someone more capable than me can review this point.
The very nature of an open source and voluntary product like HMG makes that people work on it if/when they can and are willing to.
I was only trying to point that browse is more capable than grid to manage live data.
At least this is my personal experience.
Of course any core developer can, and surely will prove me wrong.
Angel Pais
Web Apps consultant/architect/developer.
User avatar
TopsMarc
Posts: 80
Joined: Wed Apr 06, 2016 5:57 am
Location: Belgium (Flanders)

Re: GRID : problem with delete and refresh

Post by TopsMarc »

Thank you Claudio for fixing my issue with the GRID.VALUE property.
Could you also take a look please at the GRID.RECNO property I posted in april ? Play the movie GridRecNo from attachment.
On the left side I have a grid control, on the right side a browse control. Both use the same workarea with 3 records BEF, EUR and NLG.
Delete the first record (BEF) in the grid or the browse. Both grid and browse are ok.
Delete again the first record (EUR) in the grid or the browse.
The browse shows the NLG-record and is ok, but the grid shows again the EUR-record and that is not ok.
Pushing the refresh button doesn't change anything.
Another developer also wrote there is obviously some kind of navigation error in the grid. Could you fix this GRID.RECNO property too please ?

Kind regards, Marc
Attachments
VM.zip
(1.44 MiB) Downloaded 249 times
GridRecNo.zip
(2.05 MiB) Downloaded 241 times
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: GRID : problem with delete and refresh

Post by srvet_claudio »

TopsMarc wrote:Thank you Claudio for fixing my issue with the GRID.VALUE property.
Could you also take a look please at the GRID.RECNO property I posted in april ? Play the movie GridRecNo from attachment.
On the left side I have a grid control, on the right side a browse control. Both use the same workarea with 3 records BEF, EUR and NLG.
Delete the first record (BEF) in the grid or the browse. Both grid and browse are ok.
Delete again the first record (EUR) in the grid or the browse.
The browse shows the NLG-record and is ok, but the grid shows again the EUR-record and that is not ok.
Pushing the refresh button doesn't change anything.
Another developer also wrote there is obviously some kind of navigation error in the grid. Could you fix this GRID.RECNO property too please ?

Kind regards, Marc
Is not a bug, change your KR_Button_Del_Grid() function for this and see comments:

Code: Select all

FUNCTION KR_Button_Del_Grid()

// this is redundant, see:
Msgdebug( Win_KR.KR_Grid_KR.RecNo )
VM->(DBGoto( Win_KR.KR_Grid_KR.RecNo ))
Msgdebug( Win_KR.KR_Grid_KR.RecNo )

   // GRID with DataBase works with internal data buffer for Delete, Recall and Append records
   
   Win_KR.KR_Grid_KR.Delete   // marks the current record for deletion
   Win_KR.KR_Grid_KR.Save     // execute pending operations and update internal buffer, in this case delete record( DBDelete() )

   // DeleteRec()

	Win_KR.KR_Browse_KR.Value := VM->(recno())
	Win_KR.KR_Browse_KR.Refresh
	
   // Win_KR.KR_Grid_KR.RecNo := VM->(recno())
   // Win_KR.KR_Grid_KR.Refresh
   
	Win_KR.KR_Grid_KR.Setfocus
RETURN
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
TopsMarc
Posts: 80
Joined: Wed Apr 06, 2016 5:57 am
Location: Belgium (Flanders)

Re: GRID : problem with delete and refresh

Post by TopsMarc »

Hi Claudio,

I understand what you are saying, but even with the .delete and .save method, the result is the same as before. Please look at my new video GridRecno_V02 in attachment.
This time I recorded the program while debugging, so you can see I did the modifications as you said. Am I doing something wrong ?

I appreciate your help. Kind regards, Marc
Attachments
GridRecno_V02.zip
(1.59 MiB) Downloaded 211 times
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: GRID : problem with delete and refresh

Post by srvet_claudio »

TopsMarc wrote:Hi Claudio,

I understand what you are saying, but even with the .delete and .save method, the result is the same as before. Please look at my new video GridRecno_V02 in attachment.
This time I recorded the program while debugging, so you can see I did the modifications as you said. Am I doing something wrong ?

I appreciate your help. Kind regards, Marc
Please, test with my .exe file.
Attachments
_VM.rar
(1.23 MiB) Downloaded 251 times
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
TopsMarc
Posts: 80
Joined: Wed Apr 06, 2016 5:57 am
Location: Belgium (Flanders)

Re: GRID : problem with delete and refresh

Post by TopsMarc »

Hi Claudio,

When I run your EXE-file, the program works fine.
When I recompile just now without changing anything in your sources, I get again a bad GRID result.
I really don't understand that. I use Windows 10 Home, HMG 3.4.2.
I removed HMG and reinstalled HMG 3.4.2 yesterday. It didn't help. I tried installed hmg.3.4.2_patch_4 this morning too. That didn't help either for this issue. I always get a bad GRID result.
How is it possible that your compiled version works fine, and mine not ?
HMG is installed here in folder C:\HMG\ and not in c:\hmg.3.4.2\ I suppose that can't hurt ?

Kind regards, Marc
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: GRID : problem with delete and refresh

Post by srvet_claudio »

TopsMarc wrote:Hi Claudio,

When I run your EXE-file, the program works fine.
When I recompile just now without changing anything in your sources, I get again a bad GRID result.
I really don't understand that. I use Windows 10 Home, HMG 3.4.2.
I removed HMG and reinstalled HMG 3.4.2 yesterday. It didn't help. I tried installed hmg.3.4.2_patch_4 this morning too. That didn't help either for this issue. I always get a bad GRID result.
How is it possible that your compiled version works fine, and mine not ?
HMG is installed here in folder C:\HMG\ and not in c:\hmg.3.4.2\ I suppose that can't hurt ?

Kind regards, Marc
Try with this:
1) unzip attachment in your HMG folder
2) recompile my demo
Attachments
_lib_hmg.3.4.2_patch_4.rar
(509.12 KiB) Downloaded 319 times
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
TopsMarc
Posts: 80
Joined: Wed Apr 06, 2016 5:57 am
Location: Belgium (Flanders)

Re: GRID : problem with delete and refresh

Post by TopsMarc »

Hi Claudio, you are a genius !

I replaced my folder C:\HMG\LIB with yours, I recompiled the program, and now the GRID is ok.
I don't know why my libraries were not good, but I am very happy that they are now. I will redo other experiments with the GRID next few weeks.

Many many thanks.
Kind regards, Marc
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: GRID : problem with delete and refresh

Post by esgici »

TopsMarc wrote:Hi Claudio, you are a genius !
...
Many many thanks.
Kind regards, Marc
+1
Viva INTERNATIONAL HMG :D
User avatar
TopsMarc
Posts: 80
Joined: Wed Apr 06, 2016 5:57 am
Location: Belgium (Flanders)

Re: GRID : problem with delete and refresh

Post by TopsMarc »

Hi Claudio,

I am sorry to bother you again about the grid. But I am still frustrated by the grid.
Let's take a look again at the program you compiled for me with the .delete and .save method.
Please play my movie GridDeleteKeyboard in attachment.
I see strange things when I use the arrow keys on my keyboard to navigate the grid. Is that on your computer too ?

Kind regards, Marc
Attachments
GridDeleteKeyboard.zip
(1.29 MiB) Downloaded 261 times
_VM.rar
(1.23 MiB) Downloaded 300 times
Post Reply