Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programatically tell WHICH row in grid is selected?
Message
From
26/04/2000 16:13:46
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00363425
Message ID:
00363771
Views:
16
Thanks Rick...

I look into doing this. Like I mentioned to someone else - as a novice, I have never really made my own
classes of any tool. I just usually use the defaults and modify the properties as needed. My CLASSES tab
is ALWAYS blank in my Project.



>You have to create a separate grid class, e.g.
>
>
>CREATE CLASS MyGrid AS Grid OF MyControls
>
>
>Add the property to this grid class in the Class Designer.
>Drop an instance of MyGrid on the form.
>
>Rick
>
>>Thanks Marcia... except <grin>....
>>
>>How do you add a property to a grid? I only know how to add a property using the FORM/New Property pull down
>>menu option.
>>
>>Thanks
>>
>>>Hi Peter.
>>>
>>>>> Is there a way to tell which row in a grid is the CURRENT record programatically. I was thinking about
>>>using a DYNAMIC for controlling the background color of each row so that the current row is a diff
>>>color. <<
>>>
>>>Add a property to your grid called nrecNo and initialize it to 0 in the property sheet. This code in the Init of your grid class:
>>>
>>>This.nRecNo = RECNO( This.RecordSource )
>>>This.SetAll( 'DynamicForeColor', ;
>>> 'IIF( RECNO( This.RecordSource ) = This.nRecNo, RGB( 0, 0, 128 ), RGB( 0, 0, 0 ) )', 'COLUMN' )
>>>This.SetAll( 'DynamicBackColor', ;
>>> 'IIF( RECNO( This.RecordSource ) = This.nRecNo, RGB( 0,255,255 ), RGB( 255, 255, 255 ) )', 'COLUMN' )
>>>
>>>This in the grid class's AfterRowColChange:
>>>
>>>
>>>Thisform.LockScreen = .T.
>>>WITH This
>>>  .nRecNo = RECNO( .RecordSource )
>>>  .Refresh()
>>>ENDWITH
>>>Thisform.LockScreen = .F.
>>>
>>>
>>>Marcia
Peter Brama
West Pointe Enterprises

VFP is getting easier but STILL alot to learn!!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform