Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Highlighting the current row in a grid
Message
From
08/10/2002 08:27:22
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Highlighting the current row in a grid
Miscellaneous
Thread ID:
00708696
Message ID:
00708696
Views:
55
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
Stuart Reid

True nobility lies not in being superior to another man, but in being superior to one’s previous self
Next
Reply
Map
View

Click here to load this message in the networking platform