【发布时间】:2012-02-29 12:52:03
【问题描述】:
我有一个公共字段对象:
public class Field
{
public string Name { get; set; }
public string oldName { get; set; }
private object _Value = null;
public object Value
{
get
{
return _Value;
}
set
{
_Value = value;
}
}
private FieldType _fieldType = FieldType.Normal;
public FieldType FieldType
{
get
{
return _fieldType;
}
set
{
_fieldType = value;
}
}
private bool _isKey = false;
public bool IsKey
{
get
{
return _isKey;
}
set
{
_isKey = value;
}
}
}
一个公共记录对象:
public class Record
{
public string TableName{get;set;}
pubilc FieldCollection _fieldcollection = new FieldCollection();
public FieldCollection FieldCollection
{
get
{
return _fieldcollection;
}
set
{
_fieldcollection = value;
}
}
}
将数据库中的数据转换为记录对象,然后我想将记录数据绑定到控件,但它不起作用。 我想知道如何绑定数据:
textBox1.DataBindings.Add("Text", listBox1.DataSource , "BarDesc");
【问题讨论】:
标签: c# winforms data-binding binding