阅读背景:

WinForm 2.0 无代码两个DataGridView实现Master/Details

来源:互联网 

private void OnFormLoad(object sender, EventArgs e)
{
// Get the data set with parent / child tables into a data set
CustomersDataSet customers = CustomersDataSet.GetCustomers();
// Set up the data sources normally for the first grid
m_CustomersBindingSource.DataSource = customers;
m_CustomersBindingSource.DataMember = "Customers";
m_CustomersGrid.DataSource = m_CustomersBindingSource;
// Set up the data sources for the child source to point to
// the parent source, and the contained relation
m_ChildOrdersBindingSource.DataSource = m_CustomersBindingSource;
m_ChildOrdersBindingSource.DataMember = "FK_Orders_Customers";
// Child grid to child connector
m_OrdersGrid.DataSource = m_ChildOrdersBindingSource;
// Navigator to parent connector
m_BindingNavigator.BindingSource = m_CustomersBindingSource;
}private void OnFormLoad(object sender, Ev



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: