Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making grid highlighting match the current record
Message
From
09/04/1998 10:54:14
 
 
To
09/04/1998 10:47:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00090597
Message ID:
00090777
Views:
26
>>>I have a data entry form on Page 1. On page 3 I have a grid. I have some code in the grid init which highlights the current row when I click on the grid. But I'd also like the correct row in the grid to be selected when I go to Page 1 and select a record, then click on Page 3. I thought I should do this in the click event for Page 3, but I'm not sure if anything I reference in the grid at that point is valid since when I click on the page I'm not actually in the grid. Does anybody have any hints or tips with this?
>>>
>>>Thanks,
>>>
>>>Sylvia
>>
>>Could you post actual code you use for DynamicBackColor setting?
>
>***This is the code which is in my Grid Init event
>ThisForm.r_nCurrentRow = RECNO(This.RecordSource)
>This.Setall("DynamicBackColor", ;
> "IIF(RECNO(This.Recordsource) = " + ;
> "ThisForm.r_nCurrentRow, " + ;
> "RGB(0,255,255), RGB(255,255,255))", ;
> "Column")
>
>***In the When event of each item contained in the grid column, I have
>ThisForm.r_nCurrentRow = RECNO(This.Parent.Parent.RecordSource)
>
>I thought by putting a variation of this into my Click event on the Page, I could update the grid 'marker' as soon as I clicked on the page. But the marker remains 'stuck' on the first item.

Add following code:
***Grid.Afterrowcolchange event
thisform.r_nCurrentRow=RECNO(This.RecordSource)
this.refresh
Now you can eliminate code from When events, but add into Page.Activate event:
This.Grid.Afterrowcolchange()
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform