【发布时间】:2014-06-14 17:38:21
【问题描述】:
我正在尝试将大量数据加载到 listView。下面的代码正在运行,但我想创建一个列表视图项数组,然后将此数组添加到我的列表视图中。有人可以告诉我怎么做吗?
using (var csv = new CsvReader(new StreamReader(openFileDialog1.FileName), true))
{
int fieldCount = csv.FieldCount;
string[] headers = csv.GetFieldHeaders();
int i = 0;
while (csv.ReadNextRecord())
{
this.listView1.Items.Add(
new ListViewItem(new[] { csv[0], csv[1], csv[2], csv[3], csv[4] })
);
}
}
【问题讨论】:
-
什么是“问题”?
标签: c# arrays performance listview