We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Treeviewadv node editing

Thread ID:





56111 Feb 9,2007 01:00 PM UTC Feb 16,2007 07:52 PM UTC WinForms 3
Tags: Tools
Kjetil Kåresen
Asked On February 9, 2007 01:00 PM UTC

Hi, I am using the treeviewadv version
This version has a bug that is very annoying to the users. When the user click a label that is in edit mode, the label goes out of the edit mode. The expected behaviour would be that the cursor should be repositioned within the label text instead. Can you suggest any workaround for this problem? (I do not want to upgrade.)


Murugan [Syncfusion]
Replied On February 9, 2007 09:01 PM UTC

Hi Kjetil,

My sincere apologizes for the inconvenience caused. We could see the issue as you mentioned. The issue has been fixed in our latest release. Herewith I have provided the workaround for the issue.

Here is the code snippet

private void treeViewAdv1_BeforeEdit(object sender, Syncfusion.Windows.Forms.Tools.TreeNodeAdvBeforeEditEventArgs e)

e.TextBox.MouseDown -=new MouseEventHandler(TextBox_MouseDown);
e.TextBox.MouseDown +=new MouseEventHandler(TextBox_MouseDown);


private void TextBox_MouseDown(object sender, MouseEventArgs e)


Please refer to the sample and let me know if it helps you.


Thanks for using Syncfusion products.

Murugan P.S

Administrator [Syncfusion]
Replied On February 16, 2007 07:41 PM UTC

I tried your code and it indeed avoided the problem with the node going out of edit mode. However, selection with the mouse in the text box still didn't work quite as expected. Adding the below code to the TextBox_MouseDown handler seemed to solve this problem also. Thanks a lot for your support!

TextBox tb = sender as TextBox;
if (tb == null)

int startIndex = tb.GetCharIndexFromPosition(e.Location);
if (startIndex == tb.Text.Length - 1 && tb.GetPositionFromCharIndex(startIndex).X < e.Location.X)
tb.Select(startIndex, 0);

Murugan [Syncfusion]
Replied On February 16, 2007 07:52 PM UTC

Hi Kjetil,

Thank you for your update and the code snippet posted.

Have a nice weekend!

Murugan P.S


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon