开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜