Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Refresh Prob
Message
From
22/02/1999 19:18:47
Ian Matthews
Up & Running Technologies Inc
Chestermere, Alberta, Canada
 
 
To
18/02/1999 18:33:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00188597
Message ID:
00190237
Views:
15
>>>>>>I have a grid with child data that will not refresh (after a THISFORM.REFRESH) when I have changed value of the KEY in the parent and then moved the pointer in the parent:
>>>>>>
>>>>>>The following is part of my screen INIT:
>>>>>> SELECT dm_lines
>>>>>> SET filter to dm_lines.line_id = dm_request_lines.line_id
>>>>>> GO top
>>>>>> SELECT dm_operator_partners
>>>>>> set order to 1
>>>>>> SET key to dm_lines.line_id
>>>>>> GO top
>>>>>>
>>>>>>When I SKIP +1 or SKIP-1 in the parent the relevant code is:
>>>>>> SELECT dm_lines
>>>>>> SET filter to dm_lines.line_id = dm_request_lines.line_id
>>>>>> GO top
>>>>>> SELECT dm_operator_partners
>>>>>> SET key to dm_lines.line_id
>>>>>> GO top
>>>>>> thisform.refresh
>>>>>>
>>>>>>My grid properly displays all of the child info (dm_operator_partners) until I change a the value of dm_lines.line_id and issue the same:
>>>>>> SELECT dm_operator_partners
>>>>>> SET key to dm_lines.line_id
>>>>>> GO top
>>>>>> thisform.refresh
>>>>>>From this point on, if I skip +1 (with the code shown above) all the data grid disappears. The only time I can see the data in the grid is when I move the parent (dm_lines) back to the entry that I changed.
>>>>>>
>>>>>>It's like the grid's relation to the parent is stuck to the one entry in the parent that I changed (dm_lines.line_id) even though the pointer in the parent (dm_lines) has changed to another record with a different KEY value (dm_lines.line_id).
>>>>>>
>>>>>>What is realy perplexing is that if I SUSPEND and then browse all the correct data is shown in the BROWSE window. The grid simply will not display it (unless I am on the record that I changed in the parent).
>>>>
>>>>
>>>>>>
>>>>>>Any Ideas???
>>>>>
>>>>>You don't indicate whether you are making use of the .ChildOrder, .LinkMaster and .RelationalExpr properties of the grid. Are you? You migh want to take a look at these.
>>>>>
>>>>>Steve
>>>>
>>>>I have tried but that causes more probs. I have read much of the documentation on these properties but am still not clear on how to use them.
>>>
>>>.ChildOrder is just what it says.........the order that will be used to link the two together and governs what records in the child grid get displayed based on the value in the... .LinkMaster, the parent table/view. RelationalExpr is a text representation of the field(s) used to define the link. This is typically the field name of the .ChildOrder. These usually need to be in place before the tables open. The ChildOrder will take precedence over anything you set in code or in the dataenvironment of the form.
>>>
>>>
>>>Steve
>>Thanx for the info. I played around with those settings last night and now have them set but my problem still exists. I have spent over a day working on this problem and am going insane!
>
>I just today have successfully navigated past this same troublesome behavior in my own "form from hell" after *several* days of head bangin'. I'll tell you what I finally figured out and hopefully it will help you, too.<s>
>
>I'll bypass the specific details that probably don't apply to your case. What I found was that if I changed the SET KEY and REFRESHed the grid while the Page the grid is on is not the ActivePage, it would not refresh properly.
>
>Lines like the following fixed my problem:

>
>thisform.lockscreen = .T. &&-To keep the screen from jumping around
>local nPrevActivePage
>m.nPrevActivePage = thisform.pageframe1.ActivePage &&-Preserve current setting
>thisform.pageframe1.ActivePage = 2 &&-assuming child grid is on 2nd page
>
>
>thisform.pageframe1.page2.refresh()
>
>thisform.pageframe1.ActivePage = m.nPrevActivePage
>thisform.lockscreen = .F.
>
>Also, after looking at the Knowledge Base in my quest, I discovered several issues dealing with data not refreshing properly on grids. So, you might want to check there, too (if you haven't already).
>
>Good luck!<s>

Thanx for the detailed explaination. I found a artical in MS SUPPORT ONLINE KB which suggested a similar solution. I could not get that process to function properly, although I did not spend too much time on it as I was getting VERY frustrated.

I called MS for support and sent them the relevent files. They were baffeled. After another day of working on it I solved the problem myself. What I had to do was SELECT the parent table immediately before THISFORM.REFRESH.

My SKIP CODE now looks something like:
>SELECT DM_REQUEST_LINES
>SKIP+1

>SELECT dm_lines
>SET key to dm_request_lines.line_id
>GO top

>SELECT dm_operator_partners
>SET key to dm_lines.line_id
>GO top

>SELECT DM_LINES && ****** IF NOT HERE GRID DOES NOT REFRESH ********
>thisform.refresh

I have informed MS of the solution and they will get back to me if the define this as a bug or not.

I hope this helps you as well!
Previous
Reply
Map
View

Click here to load this message in the networking platform