c#“.datasource”未显示在框中
c# ".datasource" not showing in the box
每当我输入 .DataSource
时,它的底部总是显示红色或出现错误:
'ListView' does not contain a defenition for 'DataSource' and no extension method 'DataSource' accepting a first argument of type 'ListView' could be found (are you missing a using directive or an assembly reference?)
public Form4()
{
InitializeComponent();
lstProductsChosen.DataSource = products;
}
我该怎么办?我需要添加参考吗?
每当我输入 .DataSource
时,它的底部总是显示红色或出现错误:
'ListView' does not contain a defenition for 'DataSource' and no extension method 'DataSource' accepting a first argument of type 'ListView' could be found (are you missing a using directive or an assembly reference?)
public Form4()
{
InitializeComponent();
lstProductsChosen.DataSource = products;
}
我该怎么办?我需要添加参考吗?