Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

virtualtrees column filter problem

hi,

i am stuck for weeks, and hope you can help me.

i have a tree with 5 columns.

i want do create multiple filters, for each column 1

now i am doing it like this
for each combobox, and it works when i select 1 combo box, but when i selected multiple combo's it doesn't work. it will just filter on what i selected from the last combobox. but i want also what is already selected.

i am puzzling for weeks now, and i cant figure it out. what am i missing?

thanks so much


[code]Code:
procedure Tmainform.cmbgenreChange(Sender: TObject);
var
cnode1 : Pvirtualnode;
Data1 : PtreeData;
empty : boolean;
begin
sgenre:=uppercase(cmbgenre.Text) ;
if sgenre='ALL' then
begin
perrytree.BeginUpdate;
try
empty:=''='';
cnode1 := perrytree.GetFirst;
while assigned(cnode1) do
begin
data1:=perrytree.GetNodeData(cnode1);
perrytree.isvisible[cnode1]:=empty or (pos(sgenre,uppercase(data1.genre) ) > 0) ;
cnode1:=perrytree.GetNext(cnode1);
end;
finally
perrytree.EndUpdate;
end;
end;
if sgenre<>'ALL' then
begin
perrytree.BeginUpdate;
try
empty:=cmbgenre.Text='';
cnode1 := perrytree.GetFirst;
while assigned(cnode1) do
begin
data1:=perrytree.GetNodeData(cnode1);
perrytree.isvisible[cnode1]:=empty or (comparetext(sgenre,uppercase(data1.genre) ) =0) ;
cnode1:=perrytree.GetNext(cnode1);
end;
finally
perrytree.EndUpdate;
end;
end;
end; [/code]
Sign In or Register to comment.