Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid problem
Message
From
07/06/2001 11:28:09
 
 
To
06/06/2001 13:32:42
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00515652
Message ID:
00516380
Views:
19
This message has been marked as the solution to the initial question of the thread.
Hi!

The Paint event of the form is fired each time some control changes its appearance. Controls in VFP are not a real Windows controls, they're just an object that are created and maintained by VFP, all of them use the VFP form to draw self, so formPaint fired each time when this happens.

As about your particular problem, I guess it is caused by the grid refreshing. When grid refresh its rows, record pointer moves in the record source. this is known fact and it prevents use of grid in many cases. For example, record source in 3-d buffering gets updated occcasionally. This is because grid moves record pointer when refreshes self causing automatic tableupdate() for 3-d bufferend record source.

The same probably happens in your case. The linked alias is refreshed each time record pointer is moved in the paremt alias, that causes record pointer in child alias go to the top. When you check the checkbox, grid refreshes the column causing the record movement and effects you experiensed.
I guess you cannot workaround this by easy way.

Two workarounds that I know might be complex for you and I don't know if they work. One is putting a custom checkbox control over the grid and use it to check/uncheck record. This might be required for other columns too. Another solution is to maintain 2 parallel record sources. 1 is used by main grid, 2-nd is used to link to the child record source by use of the SET RELATION command. Than each time record changed in the grid, move record pointer in the 2-nd record source and refresh child grid. When parent grid is refreshed, it will move record pointer in the 1-st record source that will not refresh the chld record source and will not cause jumping of record to top.

HTH.

>Hi Will,
>
> Tracing the events I notice that checking a checkbox causes the paint event of the form to fire. Could this be having the same effect you mentioned with the refresh of causing the child table record pointer to move to the top? If so, can you think of a possible fix?
>
>Thanks,
>
>Tony
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform