virtualtrees column filter problem - Programmers Heaven

Howdy, Stranger!

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

Categories

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.