wpf - DataTrigger C# in resourceDictionary -


i have searched topics on stackoverflow, none seem work me.

i set datagrid columns based on columns in resourcedictionary. (this dictionary consists of datagridtemplatecolumn's.) 1 of these columns contains binding boolean value. not want 'true' or 'false', want have '√' or ''.

this not seem work me (datatrigger textblock). still keeps 'true' or 'false'.

this textblock inside template:

<textblock text="{binding booleanvalue}" textalignment="center">     <textblock.style>         <style targettype="{x:type textblock}">             <style.triggers>                 <datatrigger binding="{binding booleanvalue}" value="true">                     <setter property="text" value="√"/>                 </datatrigger>                 <datatrigger binding="{binding booleanvalue}" value="false">                     <setter property="text" value=""/>                 </datatrigger>             </style.triggers>         </style>     </textblock.style> </textblock> 

what missing or should change?

your datatrigger not change value of text property because set inside textblock declaration. so, once setted, never changed. allow changing, have set value inside style.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -