开发者

DataGrid.ItemsSource.Refresh() not working

I have a wpf form which contains a datagrid. I did put a button on my form to "Refresh" the datagrid. Steps I'm trying to get it to refresh:

  1. I update the viewsource from my db: SupportCaseViewSource.Source = SupportCaseManager.GetAllSupportCases()开发者_StackOverflow中文版;

  2. I refresh the datagrid items: SupportCaseDataGrid.Items.Refresh();

But nothing happens...no new data displayed!!

Has someone an idea how to do this?

Thanks

Beat


Rather than manually instructing your controls to refresh, you can implement INotifyPropertyChanged and call PropertyChanged with appropriate arguments. In your case this is probably

PropertyChanged(this, new PropertyChangedEventArgs("Source"));

It'll be whatever is bound to the SupportCaseDataGrid.ItemsSource.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜