Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HELP TIWTreeView
#4
Denville,

It sounds like your tree isn't constructed properly.  With all of that stuff not working... (as opposed to just a piece not working that could be something smaller)

My (Delphi) treeview code looks like this:

Code:
ProjectTree.ClearAll;

// loop through studies and reports.  Studies are parents to reports
lStudyNode := ProjectTree.Items.Add( nil );
lStudyNode.Caption := 'a Study Caption';
lStudyNode.Expanded := false;

lReportNode := ProjectTree.Items.Add( lStudyNode );
lReportNode.Caption := 'a Report Caption';
// stop looping

Then I set the overall on click for the tree nodes like this:
ProjectTree.TreeItemClick         := ProjectTreeTreeItemClick;

If you set DoServerSidePlusMinus, you'll get the onPlusMinus event fired when you click the plus/minus.  Otherwise it will only occur client side. If you've got DoServerSidePlusMinus set to false, and your nodes aren't opening and closing, you're probably missing JS code somehow. (or you've overridden CSS maybe?)

Your code looks right to me.  (Same as mine but the caption is set in the Add() method.  But if stuff looks corrupted, check to make sure you're not reusing tnp or other nodes you're creating incorrectly.  For a test, maybe create them with static code rather than using a loop.  And use different variables for the nodes to be sure you're not stomping on existing pointers.  Also, you can build the tree in the designer.  That would enable you to see if they open/close and allow selection properly before you try to create it at run-time.

Hope that helps,
Pete
Reply


Messages In This Thread
HELP TIWTreeView - by denville - 04-17-2019, 11:33 AM
RE: HELP TIWTreeView - by Jose Nilton Pace - 04-17-2019, 01:53 PM
RE: HELP TIWTreeView - by denville - 04-17-2019, 03:57 PM
RE: HELP TIWTreeView - by pete@pdmagic.com - 04-17-2019, 11:00 PM
RE: HELP TIWTreeView - by denville - 04-21-2019, 05:34 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)