473,378 Members | 1,489 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Accepting TreeView node names at runtime

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

Sep 6 '06 #1
3 4313
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" <av****@gmail.comschreef in bericht
news:11**********************@b28g2000cwb.googlegr oups.com...
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

Sep 6 '06 #2
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" <av****@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
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

Sep 6 '06 #3
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" <av****@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
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
Sep 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: David Elliott | last post by:
Hi, I have a Windows Explorer-like treeview that displays directories. After a cut/paste operation, I want the treeview to display the folder where the paste happened. But, I'm running into a...
4
by: meh | last post by:
I need to be able to persist a treeView to disk. I would like to save the node text, tag, image and selected image. I have done this using vb but I cant seem to translate from vb to vc#. Can ne1...
0
by: meh | last post by:
Still have not been able to convert this. More importently.....Is this sample going about it the right way??? tia meh Here is the vb code.........I keep looking at older vb.net projects to...
2
by: Stephen | last post by:
In asp.net 1.1, the IE treeview web control has a property called "SelectExpands" that, when set to true, expands a node when a user clicks the node text. I can't seem to replicate this in the...
6
by: QT | last post by:
Dear Sirs, I have a database table which has 4 column such as Document Name Subpart Title I want to make a treeview like this
1
by: Falcula | last post by:
Hello, I have a treeview control, when i select a item i navigate to url. But selected node is lost, it reset itself, loosing state. I post my code here. Thanks in advance. <script...
0
by: Falcula | last post by:
Hello, I have a treeview that i fill from a database, when i update nodename in database the treeview dont update. Its works when iam not useing enableviewstate="true" but then i loosing the...
0
Ensonix
by: Ensonix | last post by:
I found a post about this, and it had some C# code that wouldn't convert, and when I finally got it converted it didn't work in .NET 1.1. So I made a few changes to the converted VB version and now...
3
by: dutsnekcirf | last post by:
I have a treeview control on a custom task pane in Excel. I've enable the ability to use Drag & Drop (by following this how-to) on the treeview to change the order of the nodes. The problem though...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.