Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weird Behaviour from a Grid
Message
From
12/12/2006 11:28:37
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01176809
Message ID:
01176888
Views:
7
>>>Hi Folks
>>>
>>>I'm experiencing some weird behaviour from a grid, such that I've never experienced before.
>>>
>>>The grid's based on a table of some 1,700 recs or so. When I drag the slide bar thumb down to near the bottom of the grid it snaps right back up to the top and the data stay at BOF. But if I click in the slide bar the grid moves down a pageful at a time as expected.
>>>
>>>Even weirder, some times when I drag the thumb to the very bottom, then nudge it up a bit, or just when I bottom out, I get 2 "phantom" practically empty recs displayed at the top of the grid. Moving the scroll bar again gives me proper data.
>>>
>>>Thing is, there's no code on the grid other than .AfterRowColChange(). In debug, even though this action is not selecting another rec yet, .AfterRowColChange() is sometimes fired thrice for some reason, so this is an unproductive means of trying to catch the problem and gets in the way. I'd've thought that .AfterRowColChange() shouldn't be fired anyway till an actual rec is selected in the grid.
>>>
>>>Just for completeness I include the AfterRowColChange code below:
>>>
>>>With Thisform
>>>  .nOperator	= NOTETM.OPERATOR
>>>  With .pgfMainPageFrame
>>>    .Page2.cboOperators.Requery()
>>>    .Page2.Refresh()
>>>  EndWith
>>>  .lmStoreETMInfo()
>>>EndWith
>>>
>>>
>>>Anyone aware of such issues with grids or any insight into why this should happen?
>>>
>>>'ppreciate it
>>>
>>>Terry
>>
>>Terry,
>>I see 2 lines that might effect:
>>
>>> .Page2.cboOperators.Requery()
>>> .Page2.Refresh()
>>
>>Cetin
>
>Hi Cetin
>
>You were right. I looked again at the requery and realised it was totally useless. The grid page featured an operator in each rec - the cbo was to select an operator when adding or editing a rec, getting its data from the operators table. SO I realised I was requerying it for nothing, as the source was always the same, and there was no SQL in it. Duh-uh! Can't think WHY I had the line there! Must have been thinking I was sub-selecting determined by data on the grid.
>
>The refresh I also found out wasn't necessary. I must have copied the code from another similar form where it was germane.
>
>Thanks
>
>Terry

No, the problem's still there. I take that back (not the thanks, mind). The .Page2.Refresh() IS needed, so that the data on p2 reflects the selected row on the p1 grid. And the problem still persists - intermittently; it was just a fluke that I didn't see it happening after making the above changes.

Besides, as I said, just dragging down the thumb shouldn't fire .AfterRowColChange(), as the 1st rec remains selected, and no alternative row on the grid has been changed to when this phenomenon happens.

Any other ideas?

Terry
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform