How to restore old value in databinding

Topics: Getting Started
Jul 2, 2012 at 4:53 PM
Edited Jul 3, 2012 at 3:25 AM

Hello everyone,

I have been scratching my head for a while  and still can't figure it out, and hope someone here can shed some light on my problem.  

I have a master / detail scenario, which requires the detail user control to modify the record selected in master view (has a listview control). The detail user control also has two buttons, one is "Save" and the other is "Cancel".  Here is how detail user control  get called :

 <DataTemplate x:Key="DigitalRat">

            <local:DigitalControl/>       

</DataTemplate>

 <ContentControl Grid.Column="2" Grid.Row="1" Height="365" HorizontalAlignment="Left" VerticalAlignment="Top" Width="517"  Content=SelectedItem  ContentTemplate="{StaticResource DigitalRat}"/>

My problem is whenever changes are made in the detail view, the change will show up in the listview of masterview immediately.  Is there a way to get "Cancel" button involved in this, so when the "Cancel" button is clicked, the listview can restore the unmodified value on that record? 

Thanks,

George


Jul 3, 2012 at 6:10 PM

only way is via some sort of "undo" mechanism to restore the old value... store the old value, hold it till the save button is used.  If the cancel button is used then restore and update.

Only thing I can think of atm.