I am new to Powerbuilder , I have a hard time to get the value of Treeview parentnode after selecting its childnodes.
just like in .net (treeview.selected.parent).
can someone give me an idea.
TIA.
Marko
I am new to Powerbuilder , I have a hard time to get the value of Treeview parentnode after selecting its childnodes.
just like in .net (treeview.selected.parent).
can someone give me an idea.
TIA.
Marko
A small example:
//To determine this you can check the level they have for example:
treeviewitem tvi
long l_tvi
//We locate the selected item
l_tvi = tv_1.finditem(CurrentTreeItem!,0)
if l_tvi>0 then
tv_1.getitem(l_tvi,tvi)//We extract it
//The LEVEL property will tell you what level you are in
messagebox('Nivel',string(tvi.level))
end if
//Another way to identify if the item has a parent is:
long l_tvi,l_tvi_parent
//We locate the selected item
l_tvi = tv_1.finditem(CurrentTreeItem!,0)
if l_tvi>0 then
l_tvi_parent = tv_1.finditem(ParentTreeItem!,l_tvi)
if l_tvi_parent > 0 then
//The item has a parent
else
//Item has no parent
end if
end if