.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

LinkLabel as a TreeNode

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :Windows Application

Hi all;

Is there a way to have the tree nodes in a TreeView be LinkLabels?

thanks - dave

Very funny video - What's your Metaphor?

View Complete Post

More Related Resource Links

Web-Aware Apps: Build Hyperlinks into Your Client App with the Windows Forms LinkLabel Control


LinkLabels are Windows Forms controls that enable a user to hyperlink to a URL that points to either the Web or the local directory system. While the SDK documentation discusses the control, it does not demonstrate how linking is accomplished, nor does it outline the power and flexibility the control provides. This article fills those gaps, showing how to link using the LinkLabel control. It also shows the flexibility of this control for the programmer using the .NET Framework. In addition, the author covers the large number of properties that allow you to customize your controls and accurately place them. Their built-in behaviors are also discussed, along with their use in both Visual Basic .NET and C#.

Dan Hurwitz

MSDN Magazine February 2003


Helo, everyone! I would like to set text attribute of a treenode. But I want to do this in HTML. I tried it: <asp:TreeNode Text="<% =session['var'] %>" SelectAction="Expand"/> but it does not work.

Change treenode backcolor

Hello, everyone How can I do to change backcolor of treenode? 

multiple use of a TreeNode

Hej I´m trying to dynamically create a TreeView. When the TreeNodes have been created they are stored in a list, and then I will add some of them to the TreeView. My problem is that some TreeNodes should be able to be used in more than one node of the TreeView. I have tried to put them into different sub-nodes, at the same level, but they all end up in the last used sub-node. If I make a clone of the TreeNode and use the clone they all end up as I wish but I loose the control over the clone, as i want to update the TreeNodes in my list and have all nodes in the TreeView updated.   Hope anyone could give me some help on this!

How to put a TreeNode into Edit mode and make the text unselected

I have a c# app in which I would like to allow the user to enter new nodes in a TreeView control without having to use the mouse. I am able to intercept keystrokes in OnKeyDown, and the following code is working successfully: TreeNode newNode = new TreeNode( e.KeyData.ToString() ); Nodes.Add(newNode); LabelEdit = true; newNode.BeginEdit(); The problem is that the first letter in the node being edited is selected, which causes the following keystroke to replace the selected character.  Typing "HELLO" results in "ELLO", unless the user first presses the right-arrow key to deselect the selected first character. I tried setting e.Node.IsSelected = false in OnBeforeLabelEdit, but cannot because the IsSelected property is read-only. How can I programatically deselect the first character and position the edit cursor after the first character?

Customizing Windows Forms TreeNode



I want to create a treeview with dropdown lists. In fact, I need to add DropDownList to the TreeNode. I've done this with WPF but I couldn't find a way to do that on Windows forms control. Is it possible to customize the TreeNode control in order to add a dropdown box? 



Moving To a new Webserver page stopped working - BC30561: 'TreeNode' is ambiguous



Since i migrated a page to a new webserver running Asp v4 the page throws up this error I'm guessing ASPv4 it doesn't like the asp.2 code not having much of a clue of ASP I need some help to figure out how to resolve this problem. thanks in advance


Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30561: 'TreeNode' is ambiguous, imported from the namespaces or types 'System.Web.UI.WebControls, Microsoft.Web.UI.WebControls'.

Private Sub populateTreeView(ByVal strDirectory As String, ByVal nodeParent As TreeNode)
Line 58:             Try
Line 59:                 Dim CurDir As New DirectoryInfo(strDirectory)

how to make a TreeNode in treeview as the 1st child node for every or specific Parent Treenode? w




How to  make a treenode  as the 1st child node for every parent node or for some specific parent nodes.

thanks in advance

Problem to delete treeNode along with child nodes.



i have a treeView which display organization chart as hierarchical view. i want when end-user remove a treeNode, all childs of the selected node also being removed and then update database. to do this, i've used this code :

private void btnDeleteReceiver_Click(object sender, EventArgs e)

private void DeleteNode(TreeNode node)
      foreach (TreeNode childNode in node.Nodes)
      TestDataSet.ReceiversRow receiver = node.Tag as TestDataSet.ReceiversRow;

as u see in above code, i have a recursive method which delete all child nodes of the parentNode. but i'm facing a problem to delete all childs of the node. this loop could not iterate all childs node correctly. i don't know

text appears when treenode is partially visible to treeview


Hi all,

Like in Windows Explorer, when the specific treenode is partially visible and the mouse is hovered over, the tooltip like text window will appear.

Just wondering is there a similar build-in functionality in treeview?

From what I understood, this text window seems not a tooltip control per se. What is it and how it is implemented?


It's a WinForm app with C#, and I'm using .net 4.0 & VS 2010.



Cannot implicitly convert type 'System.Web.UI.WebControls.TreeNode' to 'System.Xml.XmlNode



I bind xml to treeview and select the node.I write code as

XmlNode xnParent = TreeView1.SelectedNode.Parent;
        XmlNode xnchild = TreeView1.SelectedNode;

But i got error these places.

Error    1    Cannot implicitly convert type 'System.Web.UI.WebControls.TreeNode' to 'System.Xml.XmlNode'    E:\SVN_WORK1\Projects\Server\VegaFABSWeb\Admin\DataDictionary.aspx.cs    36    28    E:\...\VegaFABSWeb\


Rama Krishna

Custom TreeNode: how to implement postback?


I use a TreeView to display a sitemap, but I wanted next to every link a small image; when clicked, it would add the link to a list of favorites in the Profile of the site user.

So I made a custom TreeNode, but I cannot figure out how to make the image postback to the page and expose an event that I can capture and use to add the link to the Profile.

Looked around here and via google, but somehow no one ever seems to have done this. Can anyone help out?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend