Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 5 Grid Not Refreshing
Message
 
To
13/12/2001 10:14:14
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00592329
Message ID:
00593862
Views:
21
Cetin,

The scenario is the grid is 4 rows and there are 4 rows in the table.
The grid currently displays rows 1-4. I click on the last row in the grid and then click on a command button somewhere else on the same form. This button invokes another form in the formset where the user edits the one row. The 'OK' button on the 2nd form does the code below. When the grid is redisplayed the only row visible is the 4th row which is at the top of the grid as if it is the only row and manual scrolling is necessary to see rows 1-3.
If more or less rows are in the table or another row is selected for editing the code below displays the rows correctly.
TIA.

thisform.VISIBLE=.F.
thisformset.FCompany.Egridsrpricat.doscroll(2)
thisformset.FCompany.Egridsrpricat.doscroll(3)
thisformset.FCompany.Egridsrpricat.setfocus()
thisformset.FCompany.refresh()
thisformset.FCompany.visible = .T.


>So where is the problem ? DEoesn't a doscroll(2) in grid.refresh work ? If non ordered :
>
>
*Grid.Refresh
>local lcSel, lnRecs, lnCurRec
>DoDefault()
>lcSel=Select()
>select (This.recordsource)
>lnCurRec=recno()
>count to lnRecs
>locate record lnCurRec
>if int((This.height - This.headerheight)/This.rowheight) > lnRecs
>	This.DoScroll(2)
>endif
>select (lcSel)
>
>Cetin
>>Cetin,
>>
>>Both the same alias * and * the row appears at top of visible grid as if it is the only one and scrolling is needed. This only occurs if the last row is selected and editing occurs in another form in the formset. As I return from the other form I do a doscroll(2) and (3) or vice versa. If the 2nd to last row (or some other row) is edited this does not occur.
>>
>>>Allan,
>>>Do they both use the same alias (not table) ? Or do you mean you're on correct record but displayed at top of grid (as if it were the only one - scrolling up needed).
>>>
>>>Cetin
>>>
>>>>Cetin,
>>>>
>>>>I found that using the doscroll(2) and (3) seems to work in * most * cases. I found the idea here (probably one of your suggestions to fix another problem :)).
>>>>However, I still have a problem in * one case * when I refresh the grid as follows and the problem is not related to changing the position of the rows in the grid.
>>>>If the # of rows in the alias exceeds the # of rows in the grid and I edit the last row in another form in the formset the grid displays incorrectly when refreshed. Even after invoking the two doscrolls, the only row that displays is the last IE the other rows are scrolled off the top of the grid.
>>>>
>>>>
Regards,

Allan Coganovitch
allanc@proven-solutions.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform