C# 将一个列表绑定到多个下拉列表

C# 将一个列表绑定到多个下拉列表,c#,winforms,binding,C#,Winforms,Binding,我有一个简单的WinForm、一个CR报告和一个类,允许用户向Crystal报告传递参数 向用户提供了两个选项来控制报告中显示的内容 WinForm: Customer ID: [dropdownlist1] to [dropdownlist2] Customer Name: [dropdownlist3] to [dropdownlist4] [OK][Cancel] 基本上,上面的WinForm允许用户选择从a到Z的客户id和/或名称范围 我连接到数据库并使用List.Addnew Cus

我有一个简单的WinForm、一个CR报告和一个类,允许用户向Crystal报告传递参数

向用户提供了两个选项来控制报告中显示的内容

WinForm:
Customer ID: [dropdownlist1] to [dropdownlist2]
Customer Name: [dropdownlist3] to [dropdownlist4]
[OK][Cancel]
基本上,上面的WinForm允许用户选择从a到Z的客户id和/或名称范围

我连接到数据库并使用List.Addnew Customerid,name来获取所有固定的200条记录Customer DB表是固定的,不会根据从Customer DB表返回的用户而增长

在我的代码中

var customer1 = new Customer();

//Do DB connection and loop through the record and add to List<T>
//List<Customer>.Add(new Customer(reader.GetInt16(0), reader.GetString(1)));

dropdownlist1.ValueMember = "customerID";
dropdownlist1.DisplayMember = "customerID";
dropdownlist1.DataSource = customer1.GetCustomerList(); //Return List<Customer>()

dropdownlist2.ValueMember = "customerID";
dropdownlist2.DisplayMember = "customerID";
dropdownlist2.DataSource = customer1.GetCustomerList(); //Return List<Customer>()

dropdownlist3.ValueMember = "customerName";
dropdownlist3.DisplayMember = "customerName";
dropdownlist3.DataSource = customer1.GetCustomerList(); //Return List<Customer>()

dropdownlist4.ValueMember = "customerName";
dropdownlist4.DisplayMember = "customerName";
dropdownlist4.DataSource = customer1.GetCustomerList(); //Return List<Customer>()
我面临的问题是,在WinForm加载之后,每当我在dropdownlist1中进行选择更改时,所有剩余的3个dropdownlists都将更改为我在dropdownlist1中选择的一个。这与我选择的其他列表的情况相同


发生了什么事?除非我在每个下拉列表中进行了更改,否则如何使单个列表独立运行?

这看起来-在数据源之间使用新的BindingContextassignments@StuartLC哦,太棒了。对于这样的事情,我甚至不知道该问什么或谷歌要什么。通常在我问任何问题之前,我都会进行谷歌或论坛搜索。@StuartLC-Gosh!成功了!谢谢你,朋友。哦,我花了15分钟来起草这个问题,你可能不到一分钟就弄清楚要搜索什么我们都在某个时候遇到过这个问题:-BindingSource通过引用跟踪数据源,所以要么需要创建新集合,即使它有相同的元素,或更改BindingSource的可能重复项