[DevExpress Support Team: CLONED FROM A344: How to filter lookup records using another cells value as a condition]
Does this sample code need to be updated? "Way 2" doesn't work. After you hit the dropdown in Medication Name once, any time you drop the list down after that, it is empty. "Way 1" is fine.
The second approach of the A344 Knowledge Base article does not work
Answers approved by DevExpress Support
Try adding the Root.Clear method call to the viewMainInitEdit procedure before applying a filter to LookupComboBox's Grid and keep me informed of your results.
Delphi...
with LGrid.DataController.Filter do
begin
Root.Clear;
Root.AddItem(colClassID, foEqual, MedClassValue, VarToStr(MedClassValue));
...
with LGrid.DataController.Filter do
begin
Root.Clear;
Root.AddItem(colNameID, foEqual, MedNameValue, VarToStr(MedNameValue));
...
Hello Ron,
Please check that ADOConnecton is connected to a DataBase file and all DataSets (TADOTable and TADOQuery) are active.
If this does not help, try the following:
attached