怎样将一个二维数组的内容添加到ListView中?
来源:百度知道 编辑:UC知道 时间:2024/05/19 10:49:53
现在有一个二维数组,没有固定长度。
我想把这个数组的内容添加进ListView中,显示为两列
怎么弄啊?
参看MSDN上的方法:
private void CreateMyListView()
{
// Create a new ListView control.
ListView listView1 = new ListView();
listView1.Bounds = new Rectangle(new Point(10, 10), new Size(300, 200));
// Set the view to show details.
listView1.View = View.Details;
// Allow the user to edit item text.
listView1.LabelEdit = true;
// Allow the user to rearrange columns.
listView1.AllowColumnReorder = true;
// Display check boxes.
listView1.CheckBoxes = true;
// Select the item and subitems when selection is made.
listView1.FullRowSelect = true;
// Display grid lines.
listView1.GridLines = true;
// Sort the items in the list in ascending order.
listView1.Sorting = SortOrder.As