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 DighePosted Sep 20, 2011, 12:15 PM
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.
.....
David SmithPosted Sep 19, 2011, 5:09 AM
Mayur DighePosted Sep 18, 2011, 6:31 AM
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);
}
}