Solved

Change .text on BeforelabelEdit

Posted on 2004-08-16
1
408 Views
Last Modified: 2008-01-09
Hi, Im trying to change the text of a node (in a TreeView), just before the user starts to edit it. Imagine the text of the node is "Products (100)". When the user edits this nodes text, he's only supposed to edit the "products" text, not the "(100)". That is an autogenerated text I add.

This little sample shows the problem:

private void treeview_BeforeLabelEdit(object sender, System.Windows.Forms.NodeLabelEditEventArgs e)
{
  ((TreeNode)e.Node).Text = "TEST";
}

The text "TEST" is never shown, the user gets to edit the text that was in the label, before this event. Is there any wordaround for this?

Thanks in advance!

/Pede

0
Comment
Question by:pede
1 Comment
 
LVL 4

Accepted Solution

by:
ErikPhilips earned 250 total points
ID: 11809370
I had simlar issues.  I had to take a alternate course of action and create a textBox that populated the value of the selectedNode.  When the textBox changed, I updated the node.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Data Saving 5 56
Linq Help 1 35
Problem to error 4 47
C# Json POSt to Rest API 4 38
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now