views:

52

answers:

1

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?

A: 

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?

Yuriy Faktorovich
I ended up doing something like that. Except Silverlight doesn't have a ListView (I've only used WPF, so I thought the controls were the same). I created a ListBox, changed it's orientation to horizontal so the items would appear as columns. Then I changed the ItemTemplate to show sub-ListBox data-bound to the User's Tasks collection. Works like a charm!
David Brown