Using: Delphi 2007
Problem : NxAutoCompletion
//---------------------CODE
//..........
NxAutoCompletion,
//........
{$DEFINE DYNAMIC}
var
tsInputList : TStrings;
tsOutputList : TStrings;
implementation
//ACol = 1 = TNxTextColumn
procedure TfrmNewEmail.NextGrid1AfterEdit(Sender: TObject; ACol,
ARow: Integer; Value: WideString);
begin
{$IFDEF DYNAMIC}
{----Works}
if (ACol = 1) then
begin
if Assigned(NxAutoCompletion2) then
begin
FreeAndNil(NxAutoCompletion2);
end;
end;
{$ENDIF}
end;
procedure TfrmNewEmail.NextGrid1Edit(Sender: TObject; ACol, ARow: Integer; Value: WideString);
begin
{$IFDEF DYNAMIC}
if (ACol = 1) then
begin
if not (Assigned(NxAutoCompletion2)) then
begin
NxAutoCompletion2 := TNxAutoCompletion.Create(Self);
NxAutoCompletion2.Sources := [asList];
NxAutoCompletion2.Strings.AddStrings(tsOutputList);//tsOutputList is already assigned
end;
if (Assigned(TNextGrid(Sender).InplaceEdit)) and (NxAutoCompletion2.Associate <> TNextGrid(Sender).InplaceEdit) then
begin
NxAutoCompletion2.Associate := TNextGrid(Sender).InplaceEdit;
NxAutoCompletion2.Enabled := True;
end;
end;
{$ENDIF}
end;//---------------------PROBLEM
The list contains for example
Jan
Japan
January
Typing in the cell the first time the first character 'J' doesn't dropdown the AutoCompleteList nor does it Autosuggest anything
After typing a second letter it starts working.
How can it be fixed so that one types from the first time a character 'J' and the AutoCompleteList works?
Regards
Jan