Question

I am developing an app using Devexpress Gridcontrol using Xaml. In a cell Template i am having a Textblock in which i want to Display 'Open' if the value in Binding is '0' and 'Close' if it is '0'. Can this be done using FormatterString ie. Using FormatStringConverter?

Was it helpful?

Solution

Hope this helps. :)

xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"


<TextBlock Text="{Binding Value}">
  <i:Interaction.Triggers>
    <ei:DataTrigger Value="0" Binding="{Binding Text, ElementName=Self}">
        <im:ChangePropertyAction PropertyName="Text"
                                         Value="Open"/>
    </ei:DataTrigger>
    <ei:DataTrigger Value="1" Binding="{Binding Text, ElementName=Self}">
        <im:ChangePropertyAction PropertyName="Text"
                                         Value="Close"/>
    </ei:DataTrigger>
  </i:Interaction.Triggers>
</TextBlock>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top