Refresh content of one window by opening new window in wpf

I am setting the data context

second window with the selected row of my data grid like this:

newdialog.DataContext=myGrid.SelectedItem;

      

what i want to do is when i change the values ​​in the new window and click ok and then update the data of the selected row in myGrid. The problem is that I am changing the data in the new window before clicking OK. It updates the data in myGrid in my first window (even when I cancel the second window).

What else should I write to display the data of the selected row in the second window? And correctly update the data in the first window. When the user clicks OK, the below conditions will be true.

if (newdialog.ShowDialog() == true)
{                   
   // Something...                         
}   

      

+3
c # wpf


source to share


No one has answered this question yet

Check out similar questions:

1270
Why not inherit from List <T>?
153
WPF and initial focus
3
New WPF window with content
1
Save changes for one object in WPF
1
Open new window after popup in wpf
0
Programmaticy opens new windows and refreshes them periodically
0
WPF Pop up View
0
Edit object in new window in wpf
0
WPF datagrid update database
0
Entity Framework Update Model Not Specified



All Articles
Loading...
X
Show
Funny
Dev
Pics