>Cetin:
>
>I get the same results when using your highlight class. All records added to grid stay highlighted.
>
>Looking in the watch window I confirmed currec = recno(), so it should work. Turning off buffering still fixes it. I wonder if it has something to do with the negative record numbers for appended records in a buffered table?
>
>Charlie
Charlie,
I'm not sure but I think it's related with AllowAddNew property = .t. For that purpose I have another class that replaces the functionality with Ctrl+DnArrow for adding. It works as intended and has this code in ARCC :
LPARAMETERS nColIndex
with this
.allowaddnew = .f.
if lastkey() = 145 and iif(.freetable,.t.,;
!(!empty(dbgetprop(.recordsource,"Table","RuleExpression")) ;
and !evaluate(dbgetprop(.recordsource,"Table","RuleExpression"))))
go bottom in (.recordsource)
.allowaddnew = .t.
keyboard "{DNARROW}"
.refresh
endif
if !empty(.cKeyField)
if empty(eval(.cKeyField))
replace (.cKeyField) with eval(.cKeyExpression)
endif
endif
.nCurRec = recno(.RecordSource)
thisform.LockScreen = .F.
IF !.lInGrid
.refresh()
ENDIF
.nActiveColumn = .findcolumn(.ActiveColumn)
endwith
Cetin