TAdvMultiColumnDropDown Grid Index Out Of Range

I have a TAdvMultiColumnDropDown that was working well.

Since last updates, (not sure but I think 8.5.x)
when a user start typing in a TAdvMultiColumnDropDown, it receives a "Grid index out of range" error.
If it selects items from drop down, no errors.

Any idea?

Do you have info how this can be reproduced?
I have retested this here with the TAdvMultiColumnDropDown in the AdvDropDownControls demo but I can't see an error when typing text.

I've made some test,

the error occur typing also only 1 char (B, C, D, E....).
Strange thing: if you type 'A' the error does not happen.
When you type the first letter, the lookup works as expected (it shows the first item that starts with that letter).

Code to initialize the component (component name: txtCliente)

    with txtCliente do
      begin
        Columns.Clear;
        LookupColumn:= 2;
        with Columns.Add do
          begin
            ColumnType:= ctText;
            AutoSize:= False;
            Header:= 'ID';
            Width:= 0;
          end; {with}
        with Columns.Add do
          begin
            ColumnType:= ctText;
            AutoSize:= False;
            Header:= 'Codice';
            Width:= 50;
          end; {with}
        with Columns.Add do
          begin
            ColumnType:= ctText;
            AutoSize:= False;
            Header:= 'Cognome e nome';
            Width:= 200;
          end; {with}
        with Columns.Add do
          begin
            ColumnType:= ctText;
            AutoSize:= False;
            Header:= 'Nato il';
            Width:= 90;
          end; {with}
        DropDownWidth:= 340;
        ColumnSizing:= False;
        DropDownAutoWidth:= False;
      end; {with}

Code to fill the items from db:

var
  tmpItem: TDropDownItem;
  idx: Integer;

  currCursor: TCursor;
  idsClientiList: TIBDataSet;
begin
    idx:= - 1;

    currCursor:= Screen.Cursor;
    Screen.Cursor:= crHourGlass;
    try
      txtCliente.BeginUpdate;
      txtCliente.Items.Clear;

      idsClientiList:= TIBDataSet.Create(Self);
      try
        idsClientiList.Database:= TMain(Self.Owner).IBDatabase;
        idsClientiList.SelectSQL.Text:= 'SELECT ' +
                                        '* ' +
                                        'FROM UTENTI ' +
                                        'WHERE NOT COGNOME LIKE ' + AnsiQuotedStr(prfClientiExclude + '%', '''') + ' ' +
                                        'ORDER BY UPPER(COGNOME), UPPER(NOME)';
        idsClientiList.Open;
        if not ((idsClientiList.Bof = True) and (idsClientiList.Eof = True)) then
          begin
            repeat
              with idsClientiList do
                begin
                  tmpItem:= txtCliente.Items.Add;

                  tmpItem.Text.Add(IntToStr(FieldByName('IDUTENTE').AsInteger));
                  tmpItem.Text.Add(FieldByName('CODICE').AsString);
                  tmpItem.Text.Add(FieldByName('COGNOME').AsString + ' ' + FieldByName('NOME').AsString);
                  tmpItem.Text.Add(DateToStr(FieldByName('DATA_NASCITA').AsDateTime));

                  if (ASelectID > 0) and (FieldByName('IDUTENTE').AsInteger = ASelectID) then
                    begin
                      idx:= txtCliente.Items.Count - 1;
                    end; {if}
                end; {with}

              idsClientiList.Next;
            until (idsClientiList.Eof = True);
          end; {if}
        idsClientiList.Close;
      finally
        idsClientiList.Free;
      end; {finally}

      txtCliente.EndUpdate;

      txtCliente.ItemIndex:= - 1;
      txtCliente.Clear;
      if (ASelectID > 0) and (idx >= 0) then
        begin
          txtCliente.ItemIndex:= idx;
        end; {if}
    finally
      Screen.Cursor:= currCursor;
    end; {finally}



Without having your data or full setup, it does not make sense to test this.
I have retested one more time our demo and tried entering A, B, C, D, ... a, b, c, d... but in none of these cases I could see an error.
Are you sure you use the latest version of the component?

Yes, this component is in that application since years,

the error occured only now.
I will try to debug using AdvMultiColumnDropDown.pas

The error occur on:

procedure TAdvMultiColumnDropDown.KeyUp(var Key: Word; Shift: TShiftState);

      if pos(c, upstr(FLookupItems.Strings, FCaseSensitive)) = 1 then
      begin
        UsrStr := Copy(Text, 1, length(c));
        AutoAdd := Copy(FLookupItems.Strings, length(c) + 1, 255);

        // if Assigned(FAutoComplete) then
        // FAutoComplete(self, UsrStr, AutoAdd, i);

        FItemIndex := i;
        FItemIdx := i;
        FItemSel := length(c);
        FItemChange := true;
        Text := UsrStr + AutoAdd;

        FLookupEntry := Text;

        SendMessage(Handle, EM_SETSEL, length(c), length(Text));

        FAdvColGrid.Row := i + FAdvColGrid.FixedRows; <<<< ERROR RAISED HERE

        Exit;

When error occurs, here the values:
FLookupItems.Count = 19621
FAdvColGrid.Row = 1
FAdvColGrid.FixedRows = 1
i = 6899
c = 'E'
c1 = 'E'
newt = 'e'
usrstr = 'e'
autoadd = 'ARLES MARIANGELA' << it's the lookup value found
Text = 'eARLES MARIANGELA'

I hope this helps

Can you contact us by email for an incremental source update that should fix this issue?

Hi, my mail is cbasso@intercomsolutions.it

We sent it by email