日期:2014-05-17  浏览次数:20979 次

关于TextBox 绑定数据源的一个问题, 请教.
this.TextBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.aTHMAINMENUBindingSource1, "ITEMNAME", true));


以上代码将TextBox1.Text与 数据实体中的属性 "ITEMNAME", 成功绑定, 这一切都没问题.


现在是想请教一下, 如何在能够查询到 TextBox1.Text 所绑定的是实体的哪一个属性?? 也就是如何得到 "ITEMNAME". 谢谢大家.

------解决方案--------------------
this.TextBox1.Tag = "ITEMNAME";

去tag里取就可以了。