Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

removing hyperlinks from treeview

Status
Not open for further replies.

wrexhamafc234

Programmer
Oct 23, 2006
18
GB
Hello all, i have a treeview on my website, which has checkboxes enabled. Because I have the checkboxes enabled, i do not want the users to be able to click on the text related to a node.

How can i go about removing these links?
 
ok, ive added the following code, but still the links appear:

in page load:
Code:
TreeView1.TreeNodeDataBound += new TreeNodeEventHandler(TreeView1_TreeNodeDataBound);

Code:
protected void TreeView1_TreeNodeDataBound(object sender, TreeNodeEventArgs e)
	{
        e.Node.SelectAction = TreeNodeSelectAction.None;
	}

any ideas why the links are still there?
 
That disables them, not remove them.. Why would you want to remove them? Nothing would be seen but a checkbox with no "description" next to them. How would the user know what they are checking.
 
I want the text for each node to be displayed, but i dont want the text to be a link.
 
Exactly the code I gave you... You may have to change the ImageSet property to change the way the nodes look.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top