Click here to Skip to main content
15,888,020 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a treeview in which, I need to add node runtime with javascript function embeded to it something like this

If trvProduct.CheckedNodes.Count = 0 Then
Dim Newnode As TreeNode = New TreeNode()
Newnode.Text = "javascript:<b id='b1' oncontextmenu="return showmenuie5(event)" > " + prdcode + "--" + prddesc + "--Qty=" + Qty.ToString() + "javascript:</b>"
Newnode.PopulateOnDemand = True
Newnode.SelectAction = TreeNodeSelectAction.Expand
Newnode.ExpandAll()
trvProduct.Nodes.Add(Newnode)
End If
But It not works please Suggest
Posted
Comments
Mohibur Rashid 15-Jul-15 19:12pm    
If you know, how to attach any function to a object it would not be a problem. Say, you want to attach a function to a object, name btn, on click event, then the code can be
btn.onclick=thefunction;
Or
btn.addEventListener=thefunction;
IE can have something else.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900