我得到了一个文本框并使用数据绑定到一个对象。这很好用,直到我尝试选择一个新的产品:
product = new Product(id);
textbox.DataBindings.Add("Text", product, "ProductName");
// After user action:
product = new Product(newId); // <- the textbox isn't updated
在产品更新后,我是否需要清除数据绑定并重新设置?