This question is locked. New answers and comments are not allowed.
I am binding a grid to a list of objects such as:
ObservableCollection<ListItem> List
Wherby the ListItem is defined as:
public class ListItem
{
public int Id;
public string Title;
// some other properties
public Item TheItem;
}
the class "Item" is defined as:
public class Item
{
public string Name;
public string Location;
public string Brand;
public string Area;
}
Question 1
I am binding my grid to the List of ListItems and therefore want to show its properties. I also want to show properties of the Item class it contains. My thinking is that the only way to do this is to dynamically construct the columns and bind them programatically. Am I correct in this thinking?
Question 2
I am using a selector for specifing the detail panes. These Detail pains are setup to bind to an Item class, NOT to a ListItem class (this is becuase I reuse the usercontrol elswhere). Can I modify the binding of the Detail item so that it does not bind to the default ListItem (to which the grid items bind) but rather to a contained object of the ListItem? How and where would I do this? Thanks for all your help!
-- xavier
ObservableCollection<ListItem> List
Wherby the ListItem is defined as:
public class ListItem
{
public int Id;
public string Title;
// some other properties
public Item TheItem;
}
the class "Item" is defined as:
public class Item
{
public string Name;
public string Location;
public string Brand;
public string Area;
}
Question 1
I am binding my grid to the List of ListItems and therefore want to show its properties. I also want to show properties of the Item class it contains. My thinking is that the only way to do this is to dynamically construct the columns and bind them programatically. Am I correct in this thinking?
Question 2
I am using a selector for specifing the detail panes. These Detail pains are setup to bind to an Item class, NOT to a ListItem class (this is becuase I reuse the usercontrol elswhere). Can I modify the binding of the Detail item so that it does not bind to the default ListItem (to which the grid items bind) but rather to a contained object of the ListItem? How and where would I do this? Thanks for all your help!
-- xavier