PC Review


Reply
Thread Tools Rate Thread

Accepting TreeView node names at runtime

 
 
avanti
Guest
Posts: n/a
 
      6th Sep 2006
Hi,

I have an application that has a tag hierarchy that is pulled from the
database and displayed in a treeview. I want to enable the user to add
nodes (tags) to this treeview at runtime and give them any names. E.g.
After "Add tag" button is clicked, the treeview has an empty node added
at a specific location and the name can be given by the user.

Is it possible?

Thanks,
Avanti

 
Reply With Quote
 
 
 
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      6th Sep 2006
Avanti

You mean as in Explorer with new folder etc.

I never did it and you are probably able to do it with painting.

However, that is probably a lot of work, if I could not find a sample on
Internet, than I would just open a dialoform, make it very small and nice,
possition it somewhere on the treeview and than let the user type in the
name he/she wants (TopMost).

Just my thought reading your message.

Cor

"avanti" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> Hi,
>
> I have an application that has a tag hierarchy that is pulled from the
> database and displayed in a treeview. I want to enable the user to add
> nodes (tags) to this treeview at runtime and give them any names. E.g.
> After "Add tag" button is clicked, the treeview has an empty node added
> at a specific location and the name can be given by the user.
>
> Is it possible?
>
> Thanks,
> Avanti
>



 
Reply With Quote
 
Claes Bergefall
Guest
Posts: n/a
 
      6th Sep 2006
Yes, something like this:

void AddNode(TreeNode parent)
{
TreeNode node = parent.Nodes.Add("<name>");
node.BeginEdit();
}

You have to set the TreeView's LabelEdit property to true

/claes

"avanti" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have an application that has a tag hierarchy that is pulled from the
> database and displayed in a treeview. I want to enable the user to add
> nodes (tags) to this treeview at runtime and give them any names. E.g.
> After "Add tag" button is clicked, the treeview has an empty node added
> at a specific location and the name can be given by the user.
>
> Is it possible?
>
> Thanks,
> Avanti
>



 
Reply With Quote
 
avanti
Guest
Posts: n/a
 
      6th Sep 2006
Great! That worked. Thanks.

Avanti Ketkar

Claes Bergefall wrote:
> Yes, something like this:
>
> void AddNode(TreeNode parent)
> {
> TreeNode node = parent.Nodes.Add("<name>");
> node.BeginEdit();
> }
>
> You have to set the TreeView's LabelEdit property to true
>
> /claes
>
> "avanti" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi,
> >
> > I have an application that has a tag hierarchy that is pulled from the
> > database and displayed in a treeview. I want to enable the user to add
> > nodes (tags) to this treeview at runtime and give them any names. E.g.
> > After "Add tag" button is clicked, the treeview has an empty node added
> > at a specific location and the name can be given by the user.
> >
> > Is it possible?
> >
> > Thanks,
> > Avanti
> >


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Expand any node then other node collaps using JS - Treeview Contro Manoj Microsoft ASP .NET 0 4th Nov 2008 01:35 PM
Treeview : Adding a node to a specific existing node with Net 1.0(work with 2.0) michelqa@yahoo.ca Microsoft C# .NET 2 12th Jun 2008 08:18 AM
How to find node in TreeView by using string(the same as Node.Text) ? jiing Microsoft ASP .NET 0 27th Apr 2007 03:34 AM
Context menu popup on treeview node returning wrong selected node Claire Microsoft C# .NET 2 5th Mar 2007 11:59 AM
How can I determine the node number of a node in my treeview meh Microsoft VB .NET 2 4th Sep 2003 04:58 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:08 PM.