Expand DBTreeview Problem

Hello Everybody

Im have some problems with the dbtreeview.
Simple structure

ID_________Level
1 Germany root
2 North
___ 1
3 Hamburg__2
4 Habor____ 3
5 Bremen___ 2
6 Habor____3
7 Emden___2

a)
The user seached “Habor”. 2 Records found. One in Hamburg and one in Bremen.

I want to expand Germany,North,Hamburg,Bremen to show the found “Habor”.

var testa = new Array(1,2,3,5) 
forms.Treeview_Objektsicht.elements.objtreeview.setExpandNode(testa,true);

This will not work! Only Hamburg is expanded?
With this it works like expected, but it is a real performance killer.
(real data has more than 10 levels and sometimes the user searches something whis more than 30 records found!!)

var testa = new Array(1,2,3) 
forms.Treeview_Objektsicht.elements.objtreeview.setExpandNode(testa,true);
var testb = new Array(1,2,5) 
forms.Treeview_Objektsicht.elements.objtreeview.setExpandNode(testb,true);

To avoid performance problem i tried:

var testa = new Array(1,2,3) 
forms.Treeview_Objektsicht.elements.objtreeview.setExpandNode(testa,true);

Now i know that 1 and 2 are allredy expanded and i do an additional

var testb = new Array(3) 
forms.Treeview_Objektsicht.elements.objtreeview.setExpandNode(testb,true);

No success!???

Is there a way to expand 2 nodes on the same level? (Hamburg and Bremen)??

Is there a way to expand the treeview for lets say 5 records found with one array or avoid double expanding of 1 and 2 in the sample above.
(1,2,3,5,4,6,…)
Any help welcomed
Best regards
Albert

The logic is always expanding one node at a time by providing the full path from top level to the node. What exactly kills performance? Expanding? Or finding the required primary keys for the path?