TAdvStringGrid - Dropdowngrid Filtering

Hi there,

in an TadvStringGrid I want to have a (virtual) column that upon entering drops down a grid, and when I type something into the cell the dropdowngrid should be filtered according to the current value in the cell.

I got the filtering part working, but when I use the filter function in grid.SetEditText or grid.BeforeDropDown something breaks and the whole grid isn't drawn anymore.

I need a hint how would I achieve what I want to. Thanks in advance!

Do you have somewhat more details.
Am I right this is a grid with the editor type edGridDropDown?
Is the cell you edit a virtual column or is the lookup in a virtual column in the dropdown grid?
How exactly & from where do you filter and what exactly do you do in SetEditText?
It would help a lot if you could isolate this and provide a sample source project with which we can reproduce this here so we have all information, properties, event handlers, code, ...

The grid is completely virtual, meaning no data stored inside the grid but in external objects, cell values are provided via onGetDisplText.

There is a GridDropDown with 3 columns, corresponding to 3 columns of the grid which are declared as AEditor := edGridDropDown. In onGetEditorProp I'm setting the grid.GridDropDown.LookupColumn to the respective column.

The GridDropDown is populated with static data using grid.GridDropDown.Items.Add. Depending on other information set in different columns I want the GridDropDown to be filtered - before the dropdown happens, and after user inputs data to narrow the selection down.

To filter the GridDropDown, I'm using this function:

procedure Tprodplanform.filterplangridDropdown(anlage: Integer; artikelnr,
  bezeichnung: String);
begin
   with plangrid.GridDropDown.FGrid do begin
      filter.Clear;
      filteractive := False;

      if artikelnr <> '' then with filter.add do begin
         condition := '*'+artikelnr+'*';
         CaseSensitive := false;
         column := 0;
      end;

      if bezeichnung <> '' then with filter.add do begin
         condition := '*'+bezeichnung+'*';
         CaseSensitive := false;
         column := 1;
      end;

      with filter.add do begin
         condition := '*A'+inttostr(anlage)+'B*';
         CaseSensitive := false;
         column := 3;
      end;


      filteractive := true;
  end;
end;

I'm calling this function in

procedure Tprodplanform.plangridSetEditText(Sender: TObject; ACol,
  ARow: Integer; const Value: string);
begin
   if Acol in [12,13] then begin
      if (ACol=12) then filterplangridDropdown(gl[ARow].Anlage, '', value);
      if (ACol=13) then filterplangridDropdown(gl[ARow].Anlage, value, '');
   end;
end;

as well as in plangrid.GridDropDown.OnBeforeDropDown.

Can you give me a hint on what I'm doing wrong here, or do you need a demo project? Thanks in advance!

A sample source test project will at least enable me to get this setup & investigating much faster than trying to reassemble all bits & pieces from this post, with the risk of overlooking what specific properties you have set that might be relevant.