Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weird Behaviour from a Grid
Message
From
12/12/2006 13:12:36
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
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:
01176927
Views:
8
>>>>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

Hmmm I remember I saw that with browses (grid anyway) this way:
If I'm on another place (say command window) and drag scrollbar down all the way, when it's on first record, scrollbar just bumps back to top. However if I do a subsequent dragging (now browse has focus) then it works as expected.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform