Can someone give me example of adding a record or to a tree node in code dynamically.
I know how to add a node, but how to add an entire row to treenode. Can some send me a small example.
At the moment I have the logic to add all of the root nodes, Now I trying to go back and a record to the tree node
foreach (var gRow in Group)
{
if (!ultraTree1.Nodes.Exists(grow.PARENT.ToString()))
{
UltraTreeNode node = new UltraTreeNode(gRow.PARENT.ToString());
this.ultraTree1.Nodes.Add(node);
}
}
Loading

Mayur DigheRank #1,078 · 1.8K reputationPosted Sep 18, 2011, 2:31 AM EDT
You can do it, try the following changes in your CODE
foreach (var gRow in Group)
{
UltraTreeNode node;
if (!ultraTree1.Nodes.Exists(grow.PARENT.ToString()))
{
node = new UltraTreeNode(gRow.PARENT.ToString());
this.ultraTree1.Nodes.Add(node);
}
}
David SmithRank #999 · 2K reputationPosted Sep 19, 2011, 1:09 AM EDT
Mayur DigheRank #1,078 · 1.8K reputationPosted Sep 20, 2011, 8:15 AM EDT
You can do it by assigning the "Title Name" for parent node, and "Other Information" as child node to it.
For this you can access data from Dataset, SqlDataReader object etc...
Follow the below link to simply connect SqlDataSource to TreeView object.
http://www.c-sharpcorner.com/UploadFile/ea36c5/8933/
As you are using ultraTree Control, the same technique can use for it for accessing data as like as Normal TreeView Control.
.....