A
A
Andrey2016-09-20 01:13:51
WPF
Andrey, 2016-09-20 01:13:51

How to synchronize Datagrid and ObservableCollection?

Voros on WPF C#.
We have Datagrid and ObservableCollection. When editing cells in the datagrid, the celleditending event fires before the ObservableCollection is updated. Those. the cell already displays the new value, while the collection still displays the old one.
If you subscribe to the ObservableCollection change event, then it occurs at the start of editing the next cell. Those. edited a cell and until we start editing another - the event will not happen.
How can I make sure that when editing the datagrid, the ObservableCollection is updated immediately?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2016-09-20
@ander822

Found an answer to your question.
How to get changed object when editing row in DataGrid WPF?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question