0

假设我在 asp 的列表框中有我的项目。(系统.Web.UI.WebControls):

100 孤独的家伙 123 124
1002 虎穴 123 125
10 大师 125 190
10000 利爪的 231 345

我该如何安排它,就像它在列中的格式一样,如下所示:

100 孤独的家伙 123 124
1002 虎穴 123 125
10 大师 125 190
10000 利爪的 231 345


希望我有人能帮我解决这个问题。谢谢。

4

1 回答 1

0
public class Form1 : System.Windows.Forms.Form
{
    private DataSet ds;
    private MultiColumnListBox listBox1;
    public Form1()
    {
        ds = DataArray.ToDataSet(new object[,]{ 
                    {"Row0, col0",  "Row0, col1" ,1},
                    {"Row00, col0", "Row1, col1" ,new object()},
                    {"Row1, col0",  "Row2, col1" ,"Some String"},
                    {"Row1a, col0", "Row3, col1" ,Rectangle.Empty},
                    {"row1aa,col0", "Row4, col1" ,1},
                    {"row0, col0",  "Row5, col1" ,1},
                    {"pow0, col0",  "Row6, col1" ,1}
                    });

        listBox1 = new MultiColumnListBox();
        listBox1.Parent = this;

        listBox1.DataSource = arr;            
    }

}
于 2014-07-01T05:39:36.733 回答