在写次文前先不得不说下网上的其他wpf的DataGrid绑定ComboBox的方式,看了之后真是让人欲仙欲死. 首先告诉你一大堆的模型,一大堆的控件模板,其实或许你紧紧只想知道怎么让combobox怎么显示出来而已. 惯例先上图: 达到这样的效果其实很简单,除了让数据模型之外紧紧只有几行代码. 先看数据模型: public class VModel : INotifyPropertyChanged { private string _Name; public string Name { get
新建一个model作为说明即可,以便查阅. 添加引用:using System.ComponentModel ; public class Test:INotifyPropertyChanged { private string name; public string Name { get { return this.name; } set { this.name = value; NotifyPropertyChanged("Name"); } } public event Prop