【问题标题】:BindingSource RefreshBindingSource 刷新
【发布时间】:2009-07-18 15:01:31
【问题描述】:

我有 2 个课程,即 CustomerOrderCustomer 课程 有一个订单集合的引用。 我使用主详细信息BindingSources。

我的问题是当我使用延迟加载模式时 对于订单,我的详细信息 BindingSource 未更新。

用户界面

BindingSource1.datasource = GetCustomers();
BindingSource2.DataMember = "Orders";
BindingSource2.datasource = BindingsSource1;

所以在我的datagridView1 点击事件中

if (customer.orders != null)
{
  customer.Orders = LoadOrders();
}

感谢您对此提供的任何帮助。

【问题讨论】:

标签: c# .net winforms business-objects bindingsource


【解决方案1】:

尝试重置绑定:

BindingSource1.DataSource = GetCustomers();
BindingSource2.DataMember = "Orders";

BindingSource2.DataSource = BindingSource1;
BindingSource2.ResetBindings(true);

【讨论】:

    猜你喜欢
    • 2013-12-21
    • 1970-01-01
    • 2015-11-04
    • 1970-01-01
    • 1970-01-01
    • 2016-07-24
    • 1970-01-01
    • 2016-03-20
    • 2012-11-06
    相关资源
    最近更新 更多