gpt4 book ai didi

wpf - 在 Listview (WPF) 上绑定(bind)日期时间类型

转载 作者:行者123 更新时间:2023-12-01 11:10:28 25 4
gpt4 key购买 nike

您好,我使用的是 C# 3.5,这可能吗?

<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("date", "{dd/MM/YYYY}") %>'></asp:TextBox></EditItemTemplate>
<ItemTemplate>

我在尝试:

<ListView Margin="0,80,0,38" Name="dlstInformes" Grid.ColumnSpan="2" >
<ListView.View>
<GridView>
<GridViewColumn Header="Numero Informe" DisplayMemberBinding="{Binding Path= numeroinforme}" >
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock >

</TextBlock>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="Nombre" DisplayMemberBinding="{Binding Path= nombreinforme}" />
<GridViewColumn Header="Fecha Informe" DisplayMemberBinding="{Binding Path= fechainforme}" />
</GridView>
</ListView.View>

最佳答案

这里有一个解决方案:

<ListView Margin="0,80,0,38" Name="dlstInformes" MouseDoubleClick="dlstInformes_MouseDoubleClick">
<ListView.View>
<GridView>
<GridViewColumn Header="Numero Informe" DisplayMemberBinding="{Binding Path= numeroinforme}" >

</GridViewColumn>
<GridViewColumn Header="Nombre" DisplayMemberBinding="{Binding Path= nombreinforme}" />
<GridViewColumn Header="Fecha Informe">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock>
<TextBlock.Text>
<Binding Path="fechainforme" StringFormat="{}{0:MM/dd/yyyy}"/>
</TextBlock.Text>
</TextBlock>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>

</GridView>
</ListView.View>

</ListView>

希望有帮助...

关于wpf - 在 Listview (WPF) 上绑定(bind)日期时间类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/528976/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com