Node edit issue

4 posts, 0 answers
  1. Niranjan
    Niranjan avatar
    23 posts
    Member since:
    Feb 2009

    Posted 04 Mar 2010 Link to this post

    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

  2. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 09 Mar 2010 Link to this post

    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.
  3. Niranjan
    Niranjan avatar
    23 posts
    Member since:
    Feb 2009

    Posted 10 Mar 2010 Link to this post

    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
  4. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 10 Mar 2010 Link to this post

    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.
Back to Top