c#winform中一个窗体要使用另一个窗体的dgv控件显示list集合数据,为什么会出现可访问性不一致啊
这是FrmUser窗口的构造函数publicFrmUser(List<Foodlist>i_lst){InitializeComponent();this.DGV_Ode...
这是FrmUser窗口的构造函数
public FrmUser (List<Foodlist> i_lst)
{
InitializeComponent();
this.DGV_Oder.DataSource = i_lst;//绑定选中数据
}
这是FrmList窗口里的函数:
List<Foodlist> lists = new List<Foodlist>();
foreach (FoodClass foods in list) //遍历集合
{
Foodlist foodlist = new Foodlist();
foodlist.Name = foods.FoodName;
foodlist.Number = foods.Number;
foodlist.Price = foods.Price;
lists.Add(foodlist);
}
FrmUser frmuser = new FrmUser(lists); 调用这句话时为什么出现可访问性不一致 展开
public FrmUser (List<Foodlist> i_lst)
{
InitializeComponent();
this.DGV_Oder.DataSource = i_lst;//绑定选中数据
}
这是FrmList窗口里的函数:
List<Foodlist> lists = new List<Foodlist>();
foreach (FoodClass foods in list) //遍历集合
{
Foodlist foodlist = new Foodlist();
foodlist.Name = foods.FoodName;
foodlist.Number = foods.Number;
foodlist.Price = foods.Price;
lists.Add(foodlist);
}
FrmUser frmuser = new FrmUser(lists); 调用这句话时为什么出现可访问性不一致 展开
6个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询