This is a migrated thread and some comments may be shown as answers.

TreeView cancel node edit

3 Answers 103 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 09 Aug 2010, 05:25 PM

How can i check while treeview node is editing if one of the keys (< > ? * | " / \ ) is pressed?
And in case that one of the keys is pressed how can i cancel edit?

Also it seems that treeview_ValueChanging event is not raised for couple of these characters.

Thanks,
Vladan

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 12 Aug 2010, 02:06 PM
Hi Vladan,

Thank you for your question. 

Please refer to the following help article which will provide you with the needed information. 

Let me know whether you have further questions.
 
Kind regards,
Stefan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jonathan
Top achievements
Rank 1
answered on 12 Aug 2010, 05:28 PM

Hi Stefan,

Maybe i was not clear with my question. I have treeview, populated with nodes. When user adds new node he can edit that node.
How can i check new text and intercept one of my characters, and if one of them is used how can i cancel edit and inform user that used character is unavailable? I tried something like this, but it didn't work:

        void FolderTree_ValueChanging(object sender, ValueChangingEventArgs e)
        {           
            char[] forbidden = {'/', '\\' , '?' , '|' , '*' , '"' , '<' , '>' , ':'};
            foreach (char newChar in forbidden)
            {
                if (((char)e.NewValue) == newChar)
                {
                    //HandleUnwantedChar
                    e.Cancel = true;
                }
            }
        } 

Do you have any idea how this simple procedure can be done?
Any sample code would be nice.
Also ValueChanged event is not raised when character | is used.

Best regards,
Vlada
0
Stefan
Telerik team
answered on 17 Aug 2010, 05:19 PM
Hi Vladan,

Thank you for your reply. 

We checked whether your scenario is possible, but unfortunately, it is not and there is not a workaround we can suggest. 

However, we are planning a major refactoring of this control in order to improve its behavior and performance.

I apologize for the introduced inconvenience. If there is anything else we can help you with, do not hesitate to contact us.
 
All the best,
Stefan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Treeview
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Jonathan
Top achievements
Rank 1
Share this question
or