Tendrias que ir almacenando en alguna otra estructura las filas que fuiste encontrando. En el evento del pintado deberias pintar todas las filas que esten dentro de esa estructura
En pseudocodigo:
Código Delphi
[-]
procedure TForm1.ListView1AdvancedCustomDrawItem(Sender: TCustomListView;
Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage;
var DefaultDraw: Boolean);
begin
if ItemEnEstructuraAdicional(Item) then
PintarItemConUnColor;
end;
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_RETURN then
begin
AgregarItemEnEstructuraAdicional(Edit1.Text);
ListView1.Repaint;
end;
end;
Como estructura adicional podrias usar una lista, un diccionario, un arbol binario.. el que mas comodo te resulte. La idea es la misma, en esa estructura adicional tenes que poder asociar un elemento del TListView (por ejemplo, el Indice) con el texto que vas ingresando en el Edit