In our scenario the data structure we need to bind to looks something like this (simplified):
The IEvent is the DataContext for the grid.
Let's say we have a type implementing ICell that exposes some extra information:
James.
public
interface
IEvent
{
ObservableCollection<IRow> Rows {
get
; }
ObservableCollection<IColumn> Columns {
get
; }
}
public
interface
IColumn
{
DataTemplate Template {
get
; }
}
public
interface
IRow
{
ObservableCollection<ICell> Cells {
get
; }
}
public
interface
ICell
{
string
Value {
get
; }
}
The IEvent is the DataContext for the grid.
Let's say we have a type implementing ICell that exposes some extra information:
Let's also assume this is implementing INotifyPropertyChanged. My custom DataTemplate for a cell might look something like this:
But this won't work because the data context for the template is the IRow, not the ICell. I think can't create a template based on the IRow because the template doesn't know the column index:
Thanks,James.