我将 TimeSpan 以刻度为单位保存到 SqlCe 中,当我将数据加载到 DataGrid 中时,我想以 HH:MM:SS 格式设置该值。我用这个试试:
<DataGridTextColumn Binding="{Binding tiempo, StringFormat={}{0:hh':'mm':'ss}, TargetNullValue=' --- '}" Width="80" Header="Tiempo"/>
Run Code Online (Sandbox Code Playgroud)
但 DataGrid 显示“hh:mm:ss”而不是值。
我也尝试尝试其他模式,例如 StringFormat="hh\:mm\:ss"
任何想法?
谢谢!抱歉我的英语不好!