【发布时间】:2011-03-25 20:27:34
【问题描述】:
我在下面定义了一个示例类:
class Shops : INotifyPropertyChanged
{
private int _productId;
private string _productName;
private List<string> _test;
private bool _active;
public int ProductId
{
get { return _productId; }
set { _productId = value; }
}
public string ProductName
{
get { return _productName; }
set { _productName = value; }
}
public List<string> Test
{
get { return _test; }
set { _test = value; }
}
public bool Active
{
get { return _active; }
set { _active = value; }
}
}
当我将此数据绑定到 DataGridView 时,除 Test 之外的所有内容都已正确绑定。在 datagridview 中也会自动创建 Active 复选框。
有没有办法告诉数据绑定 List 需要绑定为 ComboBox?
感谢您的时间。
【问题讨论】:
标签: c# data-binding datagridview