Welcome to the Xceed Community | Help
Community Search  

TextEffect

Sort Posts: Previous Next
  •  08-11-2008, 12:19 AM Post no. 13990

    TextEffect

    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

    Filed under:
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.