Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 5 Grid Not Refreshing
Message
From
14/12/2001 08:57:23
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00592329
Message ID:
00594359
Views:
32
If I ever understood the grids :) Honestly speaking most of the time I don't have an answer myself why it works but I learned to live with workarounds. Really hard to understand the grids still they're one of the most (if not the most) powerfull controls in VFP and I love them.
Cetin

>Yes, it does!
>I understand the code but I do not understand why it works.
>In other words, what assumptions are made about what would (and would not) be visible on the grid if this code was not run?
>I really want to understand the underlying gotchas of grids so that I can become more self sufficient.
>Thank you very much.
>
>>I hope this works :
>>
with thisformset.FCompany.Egridsrpricat
>>  lnRows = floor((.height - .headerheight - sysmetric(8))/.rowheight)
>>  for ix=1 to lnRows
>>    .DoScroll(0)
>>  endfor
>>  .Setfocus()
>>endwith
Cetin
>>
>>>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.
Ç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