Reputation: 24414
using WPF/C#/Entity Framework. I have a DataGrid.ItemsSource
bound to some ObservableCollection
. Now, I add a new item to the collection but DataGrid doesn't refresh. I call PropertyChanged
as well as view.Refresh()
but nothing works. Please help me.
Upvotes: 0
Views: 5237
Reputation: 3727
A common practice to refresh controls that are bound to data is using UpdateTarget() of the binding expression:
BindingOperations.GetBindingExpressionBase(myTextBox, TextBox.TextProperty).UpdateTarget();
Did you try that?
Upvotes: 0
Reputation: 1481
I think the command you are looking for is Datagrid.Items.Refresh()
Upvotes: 1