I’m going crazy. Can someone explain me why these string formats formatting the same thing are so different?
<DataGridTextColumn Header="Max Time" IsReadOnly="True" Binding="{Binding MaxTime, StringFormat=hh\\:mm\\:ss, TargetNullValue=---}">
<DataGridTextColumn Header="Min Time" IsReadOnly="True">
<DataGridTextColumn.Binding>
<Binding Path="MinTime" StringFormat="{}{0:hh':'mm':'ss}" TargetNullValue=" --- "/>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
Of course each one do not work on the other.
EDIT: The more I work with WPF the more I feel it’s not a mature enought product.
I’m no expert in formatting
TimeSpanso I can’t tell you exactly why they produce the same result but you can read up about it here: Custom TimeSpan Format StringsThey do work the same way, the thing is just that you should use one backslash within the double quotes. The following
comes out to
hh\\\\:mm\\\\:ss. So instead you should writeThe following two
Bindingsshould produce the same resultAnd so should the following two