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
180
Programaticly filling UltraWebTree from DataSet
posted

Hi,

I'm trying to fill WebTree from DataSet and I would like to know how to search for a node inside a Nodes collection, so I can use that node as a parrent to add other nodes to. I want only to search by the node's tag property.  My code is as follows:

public static Node populateUltraWebTree(DataSet ds)
    {
        Nodes nodes = new Nodes();
      
        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            Node parentNode = null;
            Node currentNode = new Node();
           
            currentNode.Text = (string)dr["TEXT"];
            currentNode.Tag = dr["ID"];
            parentNode = nodes.Search(string.Empty,dr["PARENT_ID"],nodes[0], false);
      
            if (parentNode == null)
            {
                nodes.Add(currentNode);
            }
            else
            {
                parentNode.Nodes.Add(currentNode);
            }
        }
        return nodes[0];
    }

  • 180
    Verified Answer
    posted

    Ok, I've solved my problem by creating an XML file from the Data Set and than assigning NodeBinding to correctly read the XML data.