Search code examples
treeviewtreepowerbuilderexpand

PowerBuilder - TreeViewItem issue


I am using PB 10.5

How can I hide the expand symbol (+) in a TreeViewItem object (if the node has not subnodes)???

Thank you!


Solution

  • I found the solution so fast. You have to modify the 'Children' property, just like this:

    treeviewitem my_tvi
    
    if Not IsValid(ids_childrens) then
        ids_childrens = CREATE datastore
        ids_childrens.DataObject = 'my_dw'
        ids_childrens.SetTransObject(SQLCA)
    end if
    num_children = ids_childrens.Retrieve(long(some_pk))
    if num_children <= 0 then
        my_tvi.children = false
    else
        my_tvi.children = true          
    end if