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; }
长期招聘java,有找工作可以联系我,微信:caozhenhua1563