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

How to replace editing control with MaskedTextBox?

6 Answers 74 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Dragoljub
Top achievements
Rank 1
Dragoljub asked on 09 Jan 2009, 02:36 PM
I guess the title says it all. What I would like to do is dynamically replace the editing control used to edit nodes in the tree view, and only for specific nodes. Is there a way to do this?

The reason for doing this is to enable entering a phone number with an existing mask, and not force users to enter the mask as well. There's also a need to perform custom formatting on the value of the node when it is being displayed. For example, the stored value should be 3213214321 and displayed something like (321) 321-4321. How should I do that?

6 Answers, 1 is accepted

Sort by
0
Accepted
Jordan
Telerik team
answered on 12 Jan 2009, 03:12 PM
Hi Dragoljub,

Currently, RadTreeView does not support other editors (other that the text box editor),
This is a feature that we will probably add in a future release. Unfortunately, I cannot give you specific time frame for this feature at the moment.

Regarding the formatting, you could try the newly added functionality that allows HTML-like formatting of text. For example you could set a node's text as shown below:
node.Text = "<html><b>Node text</b>"

You could also try formatting the strings that are set to the Text property of a RadTreeNode using your own custom logic.

Hope this helps.

Best wishes,
Jordan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Dragoljub
Top achievements
Rank 1
answered on 12 Jan 2009, 07:05 PM
Thanks! It helps :)

I knew this masked text box thing was a long shot, but I had to ask.

I can store the original value (the one that is stored in the database) inside the Tag. The displaying and saving the data is custom code anyway (it's not databound). It's just that I didn't work on that code and I wanted an opinion before I went into the code.
0
Jordan
Telerik team
answered on 15 Jan 2009, 07:48 AM
Hi Dragoljub,

I am glad to see that I could help.
Do not hesitate to write if you have more questions, suggestions, etc.

Greetings,
Jordan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Dragoljub
Top achievements
Rank 1
answered on 20 Mar 2009, 12:18 PM
Hi again,

From the documentation:

"RadGridView and RadTreeView share common editing patterns and interfaces, which means that the editors are automatically assigned based on the type of data that is available for editing. At present the RadTreeView uses only the text box editor for editing node Text properties. When an editor is invoked the EditorRequired event fires allowing the editor implementation to be replaced by a custom instance."

So, how do I make and/or select a custom editor, what class do I inherit from etc?

If this is not what I think it is, then give an example of what that paragraph actually means.
0
Jordan
Telerik team
answered on 24 Mar 2009, 04:35 PM
Hello Dragoljub,

Thank you for writing.

Indeed, we have plans to use in RadTreeView the same editor framework that is used in RadGridView.
Unfortunately this feature was postponed in favor of others with higher priority. It seems that our intentions were reflected in the documentation too early and then not all of the topics were updated to reflect the change of plans. This part of the documentation is now fixed.

You could try creating a custom editor by inheriting from the appropriate visual element (depending on your scenario) and implementing the IValueEditor interface. However, since this is a custom scenario it will require implementation from your side and I am afraid that this task may not be very easy.

All the best,
Jordan
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Stefan
Telerik team
answered on 22 Mar 2011, 02:44 PM
Hi Dragoljub,

Please note that in Q1 2011 we have introduced a major upgrade of RadTreeView control, which is now virtualized and fully customizable. Feel free to download the latest release and try it out. For more information on our latest release refer to this blog post

Regards,
Stefan
the Telerik team
Tags
Treeview
Asked by
Dragoljub
Top achievements
Rank 1
Answers by
Jordan
Telerik team
Dragoljub
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or