tags:

views:

228

answers:

1

Is possible to take advantage of MultiColumn property when Items collections are managed by a DataSource? (Use of DataBound items).

I want to try the following snippet :

this.listBox1.Items.AddRange(new object[] {
            "Item 1, column 1",
            "Item 2, column 1",
            "Item 3, column 1",
            "Item 4, column 1",
            "Item 5, column 1",
            "Item 1, column 2",
            "Item 2, column 2",
            "Item 3, column 2"});
        this.listBox1.MultiColumn = true;

Im using C# 3.5

Thanks

+1  A: 

I think you could try with a listview, just switch it to detail view and try something like:

    foreach (row r in collection)
    {
        ListViewItem item = new ListViewItem();
        item.Text = r.field1; //this will be col1
        item.SubItems.Add(r.field2); //col2 
        item.SubItems.Add(r.field3); //col3
        listView1.Items.Add(item);
    }

hope it helps

Luiscencio
this will work if datasource property is enable? using datasets
Angel Escobedo