Refresh DataGrid in WPF
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.
I think the command you are looking for is Datagrid.Items.Refresh()
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?
加载中,请稍侯......
精彩评论