I want to have DataGridCell with text and image.
Currently, my code looks like that
XAML:
<DataGrid Name="myDataGrid" CellStyle="{StaticResource myCellStyle}" />
Style:
<Style x:Key="myCellStyle" TargetType="DataGridCell">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding}"/>
<Image/>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
C#:
myDataGrid.ItemsSource = myDataTable.DefaultView;
The question is:
How to bind text to a TextBlock using ItemsSource?