Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Function to return what VFP will do to my code?
Message
From
14/01/2019 10:33:46
 
 
To
14/01/2019 09:53:03
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
CodeMine
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Miscellaneous
Thread ID:
01664494
Message ID:
01665383
Views:
50
>>In some grids I can reproduce it. what happens is that when resettng the controlsource, it kind of shifts and the data is not anymore aligned to the columns. This happens by itself without doing anything except set RecordSource = "" and then filling again the original recordsource, even if the cursor itself has not changed at all.
>>
>>See Screenshot, above before, below is after resetting the recordsource.
>>
>>This happens only with grids that have a lot of functionality.
>
>In your example, the first date is first displayed as date, then as datetime; the first time is displayed as time, then as "memo". So there was some extra code handling that which didn't fire when you reset the recordsource.

The code I executed was:
LOCAL lcTest
lcTest = THIS.grd.RecordSource
THIS.grd.RecordSource = ""
THIS.grd.RecordSource = m.lcTest
There is no assign method for RecordSource. Definitely no code running besides of these lines, and the recordsource cursor untouched.

I took this behavior for granted for quite some time already, what I did once while debugging, when setting for instance THIS.grd.ColumnCount = 0, it would not remove all columns. So some columns stayed as ghosts and caused this shifting effect.

Even though there are no variables hanging reference to column objects, I suppose it was some of the more complex dynamic properties that caused this behavior.

However I don't worry, because it is anyway better to have those complex settings be done outside of the form.
Christian Isberner
Software Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform