Display HTML controls inside MS Treeview control.
This is the final product, looks very nice ;-).
Well, if you will add decode HTML to a TreeView node text the browser will render that HTML into visual controls inside the tree:
Microsoft.Web.UI.WebControls.TreeNode oNode1 = new Microsoft.Web.UI.WebControls.TreeNode();
oNode1.Text = Server.HtmlDecode("<INPUT style=\"Z-INDEX: 104\" type=\"text\">");
Microsoft.Web.UI.WebControls.TreeNode oNode = new Microsoft.Web.UI.WebControls.TreeNode();
oNode.Text = Server.HtmlDecode("<INPUT style=\"Z-INDEX: 104\" type=\"text\">");
oNode.Nodes.Add (oNode1);
this.TreeView2.Nodes.Add(oNode);
As you see it’s pretty easy and might be useful. Naturally you can assign any attributes to those HTML controls, such as ID or events (including PostBacks).