on 06-07-2007 7:44 AM
Hello all,
I am using Tree control of the SAP PDK.NET and i want to add nodes as well as sub-nodes to that tree.
The data is coming from the web service and i want to assign that data to the tree nodes.
Can anybody helps me in?
Thanks in advance,
Prashant
Hi,
You can do it easily, use the following code as an exmple:
(just drop Button & Tree control first)
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
Tree1.RootNode = (TreeNode)Session["tree"];
}
}
protected void Button1_Action(object sender, AbstractButton.ActionEventArgs e)
{
TreeNode node = new TreeNode(Tree1);
node.Text = DateTime.Now.ToLongTimeString();
Tree1.RootNode.Nodes.AddAt(Tree1.RootNode.Nodes.Count,node);
Session["tree"] = Tree1.RootNode;
}
Regards,
Yehuda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.