【问题标题】:BindingSource, set datasource and then set a NEW datasourceBindingSource,设置数据源,然后设置一个新的数据源
【发布时间】:2010-09-07 11:55:43
【问题描述】:

我有一个 BindingSource,只有 1 个对象作为 DataSource。

我绑定了数据源上的一些值。效果很好。

但是。

当我这样做时:

bindingSource.DataSource = new Foo () { Bar = "..."; } 

这不会通过 UI 反映出来。

有没有办法强制更新?

我尝试在绑定到数据源的控件上重置绑定,但没有成功。

【问题讨论】:

    标签: c# winforms data-binding


    【解决方案1】:

    您是否尝试过在BindingSource 上调用ResetBindings()

    【讨论】:

      猜你喜欢
      • 2010-11-23
      • 2014-01-14
      • 2018-01-25
      • 2013-05-04
      • 2013-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多