DataGrid RowHeaderTemplate bind to Item property
-
ObservableCollection<DataItem> DataItemCollection;
class DataItem
{
DependencyProperty AProperty = DependencyProperty.Register("A",...)
DependencyProperty BProperty = DependencyProperty.Register("B",...)public string A{...}
public string B{...}
}If I have my ItemsSource on my DataGrid bound to DataItemCollection, how would I go about binding AProperty or BProperty to a Label in my DataGridRowHeader template?
tk:DataGrid.RowHeaderTemplate
<DataTemplate>
<Label Content="{Binding ...}"/>
</DataTemplate>
</tk:DataGrid.RowHeaderTemplate> -
ObservableCollection<DataItem> DataItemCollection;
class DataItem
{
DependencyProperty AProperty = DependencyProperty.Register("A",...)
DependencyProperty BProperty = DependencyProperty.Register("B",...)public string A{...}
public string B{...}
}If I have my ItemsSource on my DataGrid bound to DataItemCollection, how would I go about binding AProperty or BProperty to a Label in my DataGridRowHeader template?
tk:DataGrid.RowHeaderTemplate
<DataTemplate>
<Label Content="{Binding ...}"/>
</DataTemplate>
</tk:DataGrid.RowHeaderTemplate><Label Content="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type tk:DataGridRow}}, Path=Item.A}" />
Mark Salsbery Microsoft MVP - Visual C++ :java: