点击按钮,产生了一个随机的二维数组,想让它在listview中显示,请问怎么实现?

解决方案 »

  1.   

    添加listView1.Items.Add(new ListViewItem(new string[]{??,??});
      

  2.   

    只要是二维的,那么就可以在listview中显示,例如:
    string[][] xxx = new string[10][];
                xxx[0] = new string[] {"1", "2", "3"};
                xxx[1] = new string[] { "4", "5", "6" };
                xxx[2] = new string[] { "7", "8", "9" };
                xxx[3] = new string[] { "10", "11", "12" };
                xxx[4] = new string[] { "13", "14", "15" };
                xxx[5] = new string[] { "16", "17", "18" };
                xxx[6] = new string[] { "19", "20", "21" };
                xxx[7] = new string[] { "22", "23", "24" };
                xxx[8] = new string[] { "25", "26", "27" };
                xxx[9] = new string[] { "28", "29", "30" };            for(int i = 0 ; i < xxx.Length; i ++)
                {
                    ListViewItem item = new ListViewItem(xxx[i]);
                    listView1.Items.Add(item);
                }