3 Answers, 1 is accepted
0
Hello Jerry,
This is indeed a bug in the treeview. We will try to fix it as soon as possible.
To overcome the problem I suggest you examine the following sample:
Here I do not cancel the event, but set the NodeText variable to the old text of the node. Then in the OnClientNodeEdited event handler I check if NodeText is not null and set it as a text of the node.
I updated your Telerik Points for your involvement.
Sincerely yours,
Veskoni
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
This is indeed a bug in the treeview. We will try to fix it as soon as possible.
To overcome the problem I suggest you examine the following sample:
| <script type="text/javascript" language="javascript"> |
| var NodeText = null; |
| function IsNumeric(text) |
| { |
| var ValidChars = "0123456789."; |
| var IsNumber=true; |
| var Char; |
| for (i = 0; i < text.length && IsNumber == true; i++) |
| { |
| Char = text.charAt(i); |
| if (ValidChars.indexOf(Char) == -1) |
| { |
| IsNumber = false; |
| } |
| } |
| return IsNumber; |
| } |
| function ClientNodeEditing(sender, eventArgs) |
| { |
| var node = eventArgs.get_node(); |
| var oldText = node.get_text(); |
| var newText = eventArgs.get_newText() |
| if (!IsNumeric(newText)) |
| { |
| alert("New entry must be numeric."); |
| NodeText = oldText; |
| } |
| } |
| function OnClientNodeEditedHandler(sender, eventArgs) |
| { |
| if (NodeText) |
| { |
| eventArgs.get_node().set_text(NodeText); |
| NodeText = null; |
| } |
| } |
| </script> |
| <telerik:RadTreeView |
| ID="RadTreeView3" |
| runat="server" |
| AllowNodeEditing="True" |
| OnClientNodeEdited="OnClientNodeEditedHandler" |
| OnClientNodeEditing="ClientNodeEditing"> |
| <Nodes> |
| <telerik:RadTreeNode Text="root node"></telerik:RadTreeNode> |
| </Nodes> |
| </telerik:RadTreeView> |
Here I do not cancel the event, but set the NodeText variable to the old text of the node. Then in the OnClientNodeEdited event handler I check if NodeText is not null and set it as a text of the node.
I updated your Telerik Points for your involvement.
Sincerely yours,
Veskoni
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Jerry
Top achievements
Rank 1
answered on 23 Jun 2008, 01:22 AM
Hi, this problem seems to be not resolved in RadControl 2008 Q1 619 demo version.
0
Hi Jerry,
We could not manage to fix the problem for the SP2, but we will surely fix it in the upcoming Futures build expected on 07.07.2008.
If you need the fix earlier - just let me know and I will upload it here as soon as it is ready.
All the best,
Veskoni
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
We could not manage to fix the problem for the SP2, but we will surely fix it in the upcoming Futures build expected on 07.07.2008.
If you need the fix earlier - just let me know and I will upload it here as soon as it is ready.
All the best,
Veskoni
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center