GraffitiTreeView Rows Won't Collapse (or Expand)

The following code “works” in that the TreeView gets populated, but I can’t get the parent nodes to expand or collapse. If I build them expanded I can see the children underneath them, but they won’t collapse. If I build them collapsed, I assume the children are there, but they won’t expand to let me see.

I’ve looked in the docs, but they are sorely lacking. And the sample code in the GraffitiSuite demo works, but I can’t see any “magic” that mine doesn’t have to make the parent rows expand or collapse.

Any ideas?

[code]dim projects(), sql, countStr as String
dim lastIdx, numProjects, numAssets as integer
dim parentNode as GraffitiTreeViewNode

sql = “select projectid, name, samplecode, isfolder, parentid, expanded from projects where isfolder = ‘true’ order by disporder, name”
dim rs as RecordSet = srdata.SQLSelect(sql)
if rs = nil or rs.EOF then
else
While Not rs.eof
// these are the Folders, or Groups, at the top level
parentNode = new GraffitiTreeViewNode( rs.Field(“name”).StringValue, False, Nil, Nil, True, True, False, 0, False, False, True )
treeProjects.AddNode( parentNode )

// add any child projects
sql = "select projectid, name, samplecode, expanded from projects where parentid = '" + str(rs.Field("projectid").IntegerValue) + "' and isfolder = 'false'  order by name"
dim rs2 as RecordSet = srdata.SQLSelect(sql)
if rs2 = nil or rs2.EOF then
else
  while not rs2.EOF
    treeProjects.AddChildNode( parentNode, new GraffitiTreeViewNode( rs2.Field("name").StringValue, True, Nil, Nil, False, True ) )
    rs2.MoveNext
  wend
end if
rs.MoveNext

wend
rs.Close
end if
[/code]

I tried both AddNode and AddChildNode for the children, but there was no difference that I could see.

Jay

Hi Jay,
Assuming you have an active subscription, please open a ticket for support.
– Anthony

I don’t have an active subscription, which is why I posted here. :wink:

Hi Jay,
I have updated the documentation for this component with information that should help.
– Anthony

Thank you, @Anthony Cyphers – that was the missing piece!

For anyone else who needs this, here’s a link to the docs referenced (scroll all the way to the bottom): https://graffitisuite.com/wiki/doku.php?id=desktop:treeview