这几天用WPF作了一个小的程序,好久没做了,一个datagrid的绑定就被难住了。

原来不能用DataContext,要用ItemsSource,要进一步了解为什么了。先记下了。

//dataGrid1.DataContext = tasks;            

dataGrid1.ItemsSource = tasks;

参考:http://www.cnblogs.com/yinhaiming/articles/1643668.html

相关文章:

  • 2022-03-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2021-12-14
  • 2021-10-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案