简体   繁体   中英

Data-bind a column to a collection

I have multiple Users, each with a collection of Tasks.

public class User {
    public string Name { get; set; }
    public IEnumerable<Task> Tasks { get; set; }
}

public class Task {
    public string Name { get; set; }
}

What I would like to do in Silverlight is have each User represented as a column, with Tasks represented as items in the column. I know it's easy to data-bind with rows, but what about columns?

Can I do this with a traditional list view, or should I create my own grid-based control?

You could have a ListView inside a ListView. The parent would be the headers(in your case users), and the child ListView would have the DataSource of Task, and it would list the user's tasks. Is this possible in SilverLight?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM