public SSOHeaderLForm()
{
InitializeComponent();
this.bindingSource1.DataSource =typeof (DataCollection <SSOHeader > ) ;
//DataCollection <SSOHeader > 是类SSOHeader的集合
this.dataGrid1.DataSource = this.bindingSource1; this.Input = new DataCollection<SSOHeader >();
}
#region Input
public override object Input
{
get
{
object val;
if (this.bindingSource1.DataSource is DataCollection<SSOHeader>)
val = this.bindingSource1.DataSource;
else
val = default(DataCollection<SSOHeader>);
return val;
}
set
{
this.bindingSource1.DataSource = typeof(DataCollection<SSOHeader>);
if (value is DataCollection<SSOHeader>)
this.bindingSource1.DataSource = value; }
}
#endregion
/// <summary>
/// 刷新
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void menuItem2_Click(object sender, EventArgs e)
{
Where w = new Where();
w.Add("OrderStatus", "确认");
this.Input = this.getProxy().Find(w);//返回一个SSOHeader的集合
}
问题是我想在datagrid中只想显示SSOHeader类的ID属性
求大神帮忙
{
InitializeComponent();
this.bindingSource1.DataSource =typeof (DataCollection <SSOHeader > ) ;
//DataCollection <SSOHeader > 是类SSOHeader的集合
this.dataGrid1.DataSource = this.bindingSource1; this.Input = new DataCollection<SSOHeader >();
}
#region Input
public override object Input
{
get
{
object val;
if (this.bindingSource1.DataSource is DataCollection<SSOHeader>)
val = this.bindingSource1.DataSource;
else
val = default(DataCollection<SSOHeader>);
return val;
}
set
{
this.bindingSource1.DataSource = typeof(DataCollection<SSOHeader>);
if (value is DataCollection<SSOHeader>)
this.bindingSource1.DataSource = value; }
}
#endregion
/// <summary>
/// 刷新
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void menuItem2_Click(object sender, EventArgs e)
{
Where w = new Where();
w.Add("OrderStatus", "确认");
this.Input = this.getProxy().Find(w);//返回一个SSOHeader的集合
}
问题是我想在datagrid中只想显示SSOHeader类的ID属性
求大神帮忙
http://hi.baidu.com/xiaofeng_1/blog/item/6bb99e5c35ccc349faf2c0f6.html