Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing Rows in Grid
Message
From
07/01/2002 17:33:20
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00601625
Message ID:
00601713
Views:
25
Nadya,

Thanks for the reply. Following Marcia's reply I have it working correctly but I will check out Cetin Basoz's grid classes.

Many thanks,
Greg

>Greg,
>
>Check Highlighted grid from two grid classes in Download section here by Cetin Basoz.
>
>HTH
>
>>Marcia,
>>
>>Thanks for the clarification....As usual I sometimes can't see the forest for the trees and make things more difficult than they really are !!
>>
>>Many thanks,
>>Greg
>>
>>
>>>Hello Greg.
>>>
>>>Unless I'm completely misunderstanding how the BeforeRowColChange and AfterRowColChange events work, I don't understand why the following doesn't work, ie. highlight the current row in a grid.
>>>
>>>Actually, I think that you are misunderstanding they way that these events fire as well as how DynamicBackColor works < s >
>>>
>>>*nORecNo and nNRecNo are custom properties
>>>
>>>*BeforeRowColChange
>>>thisform.nORecNo=RECNO()
>>>
>>>*AfterRowColChange
>>>thisform.nNRecNo = RECNO()
>>>thisform.grdSearch.SetAll("DynamicBackColor","iifthisform.nnrecno=thisform.norecno)," + ;
>>> allt(str(RGB(0,255,0)))+ "," + allt(str(RGB(255,255,255))) + ")")

>>>
>>>The condition Thisform.nnRecNo = ThisForm.noRecNo will never evalutate to true. In the grid's BRCC, the record pointer is on RECNO( n ). In the grid's ARCC, the record pointer has moved and is now on RECNO( n + 1 ). If you want to highlight the current row in the grid, this code in the grid's init
>>>
>>>
>>>*** Set up for highlighting current row
>>>This.nnRecNo = RECNO( This.RecordSource )
>>>This.SetAll( 'DynamicBackColor', ;
>>>	'IIF( RECNO( This.RecordSource ) = This.nnRecNo, RGB( 0,255,255 ), RGB( 255, 255, 255 ) )', 'COLUMN' )
>>>
>>>
>>>Then, in the Grid's ARCC:
>>>
>>>
>>>Thisform.LockScreen = .T.
>>>This.nnRecNo = RECNO( This.RecordSource )
>>>This.Refresh()
>>>Thisform.LockScreen = .F.
>>>
>>>
>>>You only have to set the DynamicBackColor property once (i.e., in the grid's init). It is evaluated every time the grid is refreshed.
Previous
Reply
Map
View

Click here to load this message in the networking platform