views:

45

answers:

0

I got a List<List<X>> object and I want to bind it to a datagrid in the following way:

  1. Each entry in the outer list represents a single column
  2. Each list inner list represents the rows for each column

I need to do it in code because the size of each of the list depends on user input at runtime. Is this somehow possible? Changeing/wrapping my data structure may be an option if neccessary.

Creating the columns is not the problem, just the binding.

I forgot something: My X is not a simple type like an int but a class having different memebers and I need t specify the member to bind to. For example:

class Fruit {
 public float weight;
 public string name;
 ...
}