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.
[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
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
I tried both AddNode and AddChildNode for the children, but there was no difference that I could see.