Everything was working fine until I tried to extend the filtering to allow for case-insensitive searches (I tried to use the existing FilterOption foCaseInsensitive), now suddenly I have a bug? No, that doesn't make sense to me. I've decided to achieve the desired case-insensitive filtering another way, and keep my ego intact.
Here's the revised code (works perfectly)
cdDocs.DisableControls;
try
cdDocs.Filtered := False;
cdDocs.FilterOptions := [];
if (cbCaseSensitive.Checked) then
cdDocs.Filter := 'Product LIKE ''%' + txtFilter.Text + '%'''
else
cdDocs.Filter := 'UPPER(Product) LIKE ''%' + UPPERCASE(txtFilter.Text) + '%''';
cdDocs.Filtered := True;
finally
cdDocs.EnableControls;
end;
BTW, this is connecting to an Interbase/Firebird database using the Interbase DB Access components that ship with Delphi XE. If connecting to a different DB you may need to replace the "UPPER" function with the equivalent function for your chosen RDBMS (whatever you would use in the equivalent SQL WHERE clause)