开发者

Label StringFormat doesn't work

开发者 https://www.devze.com 2023-02-12 15:19 出处:网络
I am trying to format a {datetime?} property with stringFormat, but I don\'t know why it doesn\'t applied to.

I am trying to format a {datetime?} property with stringFormat, but I don't know why it doesn't applied to.

this is my code

<DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
        <Grid>
         开发者_高级运维   <Label Content="{Binding From, StringFormat='{}{0:dd.MM.yyyy}'}"/>
        </Grid>
    </DataTemplate>
</DataGridTemplateColumn.CellTemplate>

Am I doing something wrong?


Put the contents of the label into a TextBlock

<Label>
    <TextBlock Text="{Binding Path=From, StringFormat='{}{0:dd.MM.yyyy}'}"/>
</Label>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号