3
두 개의 그리드가있는 마스터 세부 양식이 있습니다. customers = master, orders = detail. 마스터 그리드에서 새 고객을 선택할 때 세부 사항을 새로 고치는 방법은 무엇입니까? 여기 내 코드입니다 :선택한 마스터 항목이 변경되면 세부 사항을 새로 고치는 방법은 무엇입니까?
public partial class Form1 : Form
{
AutoLotEntities context = new AutoLotEntities();
BindingSource customerBindingSource;
BindingSource orderBindingSource;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
customerBindingSource = new BindingSource();
orderBindingSource = new BindingSource();
customerBindingSource.DataSource = context.Customers;
orderBindingSource.DataMember = "Orders";
orderBindingSource.DataSource = customerBindingSource.DataSource;
grdCustomers.DataSource = customerBindingSource;
grdOrders.DataSource = orderBindingSource;
}
}
내가 IDE의 도움으로 그것을 할 관리하는 Form1.Desginer.cs에서 코드를 생성하지만 어떻게이 일의 작품을 볼 수 비 생성 된 코드와 손으로 작업을 수행 할 .