Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid highlight row problem
Message
De
10/09/2003 16:28:18
Dorin Vasilescu
ALL Trans Romania
Arad, Roumanie
 
 
À
10/09/2003 08:41:31
Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00827806
Message ID:
00827988
Vues:
17
I had a similar problem, some times ago, when I was trying to design a Find-Find next dialog that behaves like Find-Find next dialog in a Browse window, and refresh the grid on the underlying form.
The solution was to resize the grid for only one row to fit, refresh() it, then resize it back.
I used code below (from top form)
IF !ISNULL(thisform.oGridRef)
	thisform.oFormRef.LockScreen = .t.
	WITH thisform.oGridRef
		lnH = .height
		*resize the grid to display only one row
		.height = .headerheight+SYSMETRIC(8)+.GridLineWidth*2
		.refresh
		.ActivateCell(1,1)
		.height = lnH
	endwith
	thisform.oFormref.LockScreen = .f.
ENDIF
oFormRef is a reference to the calling form
oGridRef is a reference to the grid on calling form (if exists)

Maybe you can use the same idea to solve your problem.


>Hi Vlad,
>
>I posted the following message at the UT and it was suggested by Nadya that I try to contact you to see if you could help me with this issue.
>
>In summary, the problem seems to be that a VFP8 grid somehow looses its row highlighting if the grid is scrolled on a form that does not have focus. Could you kindly check it out and let me know if you have any ideas. Any help is greatly appreciated.
>
>TIA
>
>
>
>>Hello,
>>
>>I have several VFP8 forms each containing a grid that is setup as a "list". That is, the grid has the new persistent highlight row set on and no cell can be edited. Each of these grids contain different fields from the same underlying table's record and each grid also has one field that is common to all grids.
>>
>>What I am trying to do is have the highlighted records in each grid synchronize such that as I move thru records in one grid, all other grids in the other forms, move and highlight their corresponding record. Thus far, I've created and array reference to the individual forms and from the grid's AfterRowColChange event I loop thru each form's reference and seek the appropriate record (based on the common fields) then issue a form.refresh().
>>
>>This approach appears to work ok for the first few times, but after interacting with the forms (like switching between them and moving the record pointer in the grid and switching back) the highlight "gets lost" on the other forms. All grids appear to be coordinated because I can see the information in the associated form's grid change. In addition, if I activate the form where the highlight "got lost", the grid will highlight the correct record so I know the synchronization works. Its just that the highlight row sometimes fails to highlight (until I activate the form).
>>
>>
>>Anyone else experience this or have any ideas as to what is happening?
>>
>>
>>Thanks in advance
>>
>>Regards,
>>
>>Mike
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform