Hello,
I am trying to color specific characters in a string inside a cell but am not sure the best way to do this with the DataGrid.
I have achieved this in the past using a collection of "TextEffect" objects and assiging them to a TextBlock, but this will not working using the DataGrid as each cell is bound to its string representation and not the Item itself, so you can't do something like this:
<DataTemplate x:Key="customerNameDataTemplate">
<TextBlock Text="{ Binding Path=CustomerName" TextEffects="{Binding Path=GetCollection}" />
</DataTemplate>
You have to do this instead:
<DataTemplate x:Key="customerNameDataTemplate">
<TextBlock Text="{ Binding }" TextEffects="{Binding Path=GetCollection}" />
</DataTemplate>
But now I can't get access to my TextEffects property "GetCollection" :(
Is there a way to get access to the Item and not the specifically bound property string? Or maybe I am going about this the wrong way?
Help appreciated!
Thanks
Jamie