|
Rank: Advanced Member Groups: Member
Joined: 4/30/2009 Posts: 36
|
I have done a search on this topic, but found nothing. I can see your demo on how to add a custom control manually, but how can you add one programmatically at runtime?
TrvGroup.Nodes.Add() ?
Thanks Kennaxx
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You will need to add a CustomItem dynamically first. You can place a Panel in your page then dynamically add a CustomItem into that Panel. Once you added the CustomItem, add a TreeNode as usual and then set that node's CustomItemID to the ID of the newly added CustomItem.
If you are only adding simple HTML element such as a CheckBox or an ImageButton, it may be easier for you to set the TreeNode's Text to some raw HTML directly.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 4/30/2009 Posts: 36
|
EO,
Should this not create a custom embedded HyperLink Object? It does create a node but it does not show as Hyperlink.
Thanks
EO.Web.CustomItem newItem = new EO.Web.CustomItem(); HyperLink link = new HyperLink(); link.Text = "Please Click Me"; newItem.Controls.Add(link); EO.Web.TreeNode RootNodex = new EO.Web.TreeNode(); RootNodex.Text = "Fox"; RootNodex.Value = ""; RootNodex.CustomItemID = "newItem";
myNode.ChildNodes.Add(RootNodex);
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
There are two problems in your code:
1. You need to add the CustomItem into your page. When you set a Node's CustomItemID, it points to that CustomItem, which itself must exist in the page;
2. You need to set the HyperLink's NavigateUrl property. HyperLink is useless unless you set NavigateUrl;
Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 4/30/2009 Posts: 36
|
Thanks EO. It working fine now.
THanks
|
|