Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to keep grid records in order as key field is change
Message
From
23/01/2005 23:09:29
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00979904
Message ID:
00979920
Views:
25
>Hi, Alex.
>
>>>>A grid shows rows of an ordered table. As new records are added they show at the top of the grid, as they should. When the key field is changed I'd like the current record to show in the appropriate relative position in the grid at about the middle visible row of the grid. How do you accomplish that?
>>>
>>>grid.Refresh() ?
>>
>>Hi Martin,
>>
>>It doesn't do it, at least not if I place it in the valid of the textbox in the grid. It isn't essential, so don't worry.
>
>Oh, I see. It can get a bit tricky when you're editing over the gird itself.
>
>Try the following:
>1. Save the record pointer
>2. Skip to the next record
>3. Refresh
>4. Return to the record
>5. Refresh again
>
>You may even try without refreshing in step 3, as it can produce a small flicker effect, but it can be needed.

Thank you, Martin.

I placed the following code in the textbox valid and it works. The only problem is that the row moves to the top of the grid under some circumnstances. I once worked around something similar with DoScroll in a timer, but it was not a very good solution, so it will stay like this.
  REPLACE OrderBy WITH This.Value
  This.Parent.Parent.Refresh()
Alex
Previous
Reply
Map
View

Click here to load this message in the networking platform