Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: have added node text visible  (Read 547 times)

0 Members and 1 Guest are viewing this topic.

uildriks

  • Customer
  • Newbie
  • *
  • Offline Offline
  • Posts: 4
have added node text visible
« on: December 14, 2009, 12:24:52 PM »
With the following code I would expect 'hello world' to appear.

VS2008, FTV latest version

        public void LoadSampleData(ARMSoft.FlexibleTreeView.FlexibleTreeView treeView)
        {
            ARMSoft.FlexibleTreeView.Nodes.Node n = new ARMSoft.FlexibleTreeView.Nodes.Node("hello world 1");
            treeView.Nodes.Add(n);
            Node n1 = new Node("1");
            n1.Text = "hello world 2";
            n1.AttachTo(treeView);
        }

Ruslan

  • Flexible TreeView Team
  • Sr. Member
  • *****
  • Offline Offline
  • Posts: 496
Re: have added node text visible
« Reply #1 on: December 14, 2009, 03:26:28 PM »
Hello,

Thank you for your interest to our product.
Flexible TreeView a bit more complex than the standard treeview control. It may display many data types using node controls.
Please read our Knowledge Base for details.
In your case you need to add NodeTextBox in order to display a text in the tree:

Code: [Select]
// or use the NodeControls treeview property in the VS forms designer.
NodeTextBox tb = new NodeTextBox();
tb.AttachTo(tree);
tb.DataFieldName = "Text";  // node class member name where to get data to display. The 'Text' is the default value!

// add nodes
Node n = new Node("hello world 1");
treeView.Nodes.Add(n);
Node n1 = new Node("1");
n1.Text = "hello world 2";  // you`ve initialized the node`s Text property in the constructor so you don`t need this line!
n1.AttachTo(treeView);
 

Copyright © 2006-2012 ARMSoft. All rights reserved.