Re: Treeview Node Type
- From: "Robbe Morris [C# MVP]" <info@xxxxxxxxxxxxxxx>
- Date: Sat, 13 May 2006 15:11:48 -0400
I've done this sort of thing a variety of ways. The most flexibility
and less troublesome in regards to managing parent object references
if you do a bunch of drag and drop of tree nodes is do to
the following.
Create a simple class that has some sort of Guid or Unique ID, an
object name or possibly an enum, and a text description.
Store this object in the TreeNode.Tag property. Whenever
you get the selected node, grab the .Tag
CustomClass rob = (CustomClass)tree.SelectedNode.Tag;
--
Robbe Morris - 2004-2006 Microsoft MVP C#
Earn money answering .NET questions
http://www.eggheadcafe.com/forums/merit.asp
"Chris" <nospam@xxxxxxxxxxxxxx> wrote in message
news:e2vNgJpdGHA.3352@xxxxxxxxxxxxxxxxxxxxxxx
Is there any way when progratically adding nodes to assign them some kind
of type group nodes that want to different things to. I am creating an
Explorer type interface and need to differentiate between folder and file
nodes in my code. Regards, Chris.
.
- Follow-Ups:
- Re: Treeview Node Type
- From: Chris
- Re: Treeview Node Type
- References:
- Treeview Node Type
- From: Chris
- Treeview Node Type
- Prev by Date: Re: 2.0: setting TextBox.Text
- Next by Date: Re: Hyperlink column on ASP.NET Grid issue
- Previous by thread: Re: Treeview Node Type
- Next by thread: Re: Treeview Node Type
- Index(es):
Relevant Pages
|