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

Node edit issue

3 Answers 72 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Niranjan
Top achievements
Rank 1
Niranjan asked on 05 Mar 2010, 04:28 AM
Hi,

I have tried the attached examples from the post http://www.telerik.com/community/forums/silverlight/treeview/editing-item-in-radtree-makes-it-dissappear.aspx. All the examples work well. If I provide 

Text

="{Binding Name, Mode=TwoWay}" in the CellEditTemplate the value is changed automatically in the Object as well.
My Problem is as below.
I am paasing the updated object for saving. if all goes well then no problem but if there is some problem in saving (Some exception is return from the save functionality) then I want to again rollback to the old value in the tree and also in the object. In the Edited event if you look the Properties "OldValue" and "NewValue" both are getting changed because of the Text="{Binding Name, Mode=TwoWay}" . I think twoway binding should not change the "OldValue" property. It should only change the "NewValue" property.

Is there any workaround for getting the old value? I dont want to fetch again from database.

Regards,
Niranjan

3 Answers, 1 is accepted

Sort by
0
Tihomir Petkov
Telerik team
answered on 09 Mar 2010, 01:51 PM
Hello Niranjan,

From your description of the scenario you implement it seems that you will have to provide a fallback mechanism for the process of comitting changes back to the server. A possible approach would be to cache each item that is edited and in the case of commit failure simply restore the item from the local cache.

All the best,
Tihomir Petkov
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
Niranjan
Top achievements
Rank 1
answered on 10 Mar 2010, 11:14 AM
Hi

Thanks for the reply.

Actually I am binding the cached object with the tree view. So I think I have to make copy of the object in the "EditStarted" event. and if the saving of object fails, I can restore it from the copied object.

Please let me know am I going in right direction or not?

Regards,
Niranjan
0
Tihomir Petkov
Telerik team
answered on 10 Mar 2010, 04:40 PM
Hello Niranjan,

Yes, this is exactly what I meant.

Sincerely yours,
Tihomir Petkov
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
Niranjan
Top achievements
Rank 1
Answers by
Tihomir Petkov
Telerik team
Niranjan
Top achievements
Rank 1
Share this question
or