Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refresh of grid sometimes fails
Message
From
11/06/2021 17:47:30
 
 
To
11/01/2021 13:09:29
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01677764
Message ID:
01681151
Views:
96
Hi Mike (and any others):

I have tried the .RealRefresh() that you mentioned (for those of you reading this, this is a method in the VMP framework that tries to get around refresh problems). It does not make any difference on a) right-click on a grid which I then use to do a .ShellRequery() or b) drag and drop onto the grid. Other than that, when using buttons to add or delete a row from the grid, it behaves.

I have tried adding a .RealRefresh() to the last line of code in the .Rightclick() method. And I have put the .RealRefresh() at the very bottom of the .ShellRequery() method.

I have not actually tried Christian Isbener's suggestion about adding a timer and having that fire a bit later (as that was a bit more work). Will do that next if the client really wants this fixed - they don't use the right click stuff much or drag drop much.

Until that happens, what is peculiar about right-click or drag drop that would cause the refresh to not work?

Albert


>>Hi Christian,
>>
>>Thanks. In the framework I work in (VMP), it gives an indication that the refresh does not always work as it should. Here is the note from the framework (I can't get any comment from the developer as VMP is no longer around):
>>
>>* A "real" Refresh. The native Refresh leaves
>>* the RelativeRow/ActiveRow intact, even though
>>* you might have moved the record pointer.
>>
>>The rest of the code there just seems to work at repositioning the record pointer and then it does a native .Refresh().
>>
>>I will keep your tip and if what I have just worked in does not work, I will work in the timer to see if that helps.
>>
>>Thanks,
>>Albert
>>
>>>I have usually problems when I have a button on a grid that deletes the current row. Even after a skip a subsequent refresh would keep the deleted row visible. When grids misbehave, I do a refresh using a timer, that would refresh the grid a few milliseconds later, and it usually works much better.
>>>
>>>Timer.Enabled = .F.
>>>Timer.Interval = 200
>>>
>>>To Refresh the grid:
>>>THISFORM.tmrRefresh.Enabled = .T.
>>>
>>>And the TIMER() method of the timer:
>>>
>>>THIS.Enabled = .F.
>>>THISFORM.grd.Refresh()
>>>THISFORM.grd.SetFocus()
>>>
>
>Are you calling VMPs RealRefresh() instead of the native refresh?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform