Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
330
Binding WebTree to a class
posted

Hi Guys,

 This is possibly the dumbest question in the world... I have a class populated with data, lets say for simplification...

public class MyNodes
{
  public ArrayList Children;
  public String NodeName;
}

How would I use this as a DataSource for UltraWebTree?

  • 330
    Verified Answer
    posted

    In answer to my own question...

    Use the _NodeExpanded event... and add nodes as such:-

    foreach( MyNode n in MyNodes )
    {
      Node ultraNode = new Node();
      ultraNode.Text = n.NodeName;

      // Where "MyKey" can be used to retrieve sub-nodes
      ultraNode.DataKey = n.MyKey;
      ultraNode.ShowExpand = true;

      e.Node.Nodes.Add(ultraNode);
    }