Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Highlighting the current row in a grid
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00708696
Message ID:
00709793
Views:
16
You can consider using Grid Highlighter v. 3.8.1 File #9798.

>I have a parent-child form with a grid containing the child records. I ahve add the following code the grid to highlight the current row:
>
>in the init method of grid:
>*** Set up for highlighting current row
>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' )
>
>WHEN event of grid:
>This.LeaveGrid = .F.
>
>VALID event of grid:
>This.LeaveGrid = .T.
>
>BEFOREROWCOLCHANGE event of grid:
>IF !This.LeaveGrid
> This.nRecNo = 0
>ENDIF
>
>WHEN event of each column in grid:
>WITH THIS.PARENT.PARENT
> .nRecNo = RECNO(.RECORDSOURCE)
>
>It appears to work fine for records already in the grid, but when you add a record to the grid, the row for each record that u have added is highlighted, instead of just the current row.
>
>Is there a way to correct this or does it have to do something with the buffermode. I have set the buffer mode to 5 for the child table.
>
>Regards,
>
>Stuart
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform