Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stay highlighted after move down
Message
De
24/08/2001 17:33:30
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00548998
Message ID:
00549017
Vues:
19
>Instead of going through all that trouble, would DoScroll() do what you are ultimately trying to accomplish? I am a bit confused as to what you are doing. Are you setting the RecordSource everytime you move up or down? That would be a bit of overkill.

Hi Mark,

Thanks for the reply. Sorry, I'll try to clarify a bit. The move up and move down buttons sets the order in which the records appear in the grid. So the grids record source is a sql statement that has pulled two fields, rank and description ordered by the rank. Say the grid has two records:
rank description
001 hello --> highlighted
002 how are you?

When you click the move down button it basically swaps the two ranks, so you'd get:
rank description
001 how are you?
002 hello --> want to keep highlighted after move down

I set the recordsource in the init event of the form, and after you click the 'move down' button. (I had problems getting the grid to refresh so I just reset the recordsource) Before you click the 'move down' button hello is highlighted. I am trying to keep hello highlighted after you press the 'move down' button.

Thanks,
Chris
>
>>Hi,
>>
>>I have a grid who's recordsource is a sql statement. Anyways, I have 'move up' and 'move down' buttons on the form. I've got that working. After some troubles I was able to get the grid to refresh. Here's how
>>
>>with thisform.grdQuestions
>>	.recordsource="select question, rank, tkey, qkey from qtable " + ;
>>                "into cursor questions order by rank" + ;
>>		" where tkey = '" + lcTkey + "'"
>>	.refresh()
>>	.setfocus()	
>>endwith
>>
>>
>>Here's the problem I don't know how to solve. After the grid is refreshed I would like the record that was moved to be still highlighed, instead of the first record being highlighted. For example,
>>
>>grid contents before move down
>>"Hello"
>>"How Are you"
>>"I am fine"
>>
>>grid contents after move down
>>"How Are You"
>>"Hello"
>>"I am fine"
>>
>>Any ideas? I tried making a index on the cursor and seeking the correct record after the refresh, but that caused problems.
>>
>>Chris
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform