Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid jumps after re-ordering the record source
Message
From
14/07/2005 13:48:24
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01032650
Message ID:
01032728
Views:
22
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>Perhaps I asked this question already. There is one annoying behavior of the grid, which I need to overcome. When I click on the column's header, I'm re-ordering on that field and I'm still on the same record. Is where a way to avoid scrolling up or down of the grid? E.g. grid should remain with the same amount of records before the selected record and after it?
>
>Or it is impossible without changing the record position?
>
>Thanks in advance.

Hi Nadya,
the VFP's grid is enough poor.

Becuase the only fixed point is the first line,
Then:
* header click
* snip code
thisForm.LockScreen = .T.
WITH m.this.Parent.Parent
    PRIVATE relativeRow
    * backup the relativerow
    FOR relativeRow=2 TO .RelativeRow
	.DoScroll(1)
    ENDFOR
*   ASSERT .RecordSource==ALIAS()
*   SELECT (.RecordSource)
******************************
*   Put change order code Here
******************************
*   this.Picture = IIF(DESCENDING(),IMMAGINE_ORDINE_DECRESCENTE,IMMAGINE_ORDINE_CRESCENTE)
*   The trick : the refresh is done with the first row fixed
    .Refresh  && resync the grid's rows
* restore the relative row
    FOR relativeRow=3 TO m.relativeRow
       =.DoScroll(0)
    ENDFOR
ENDWITH
thisForm.LockScreen = .F.
Previous
Reply
Map
View

Click here to load this message in the networking platform