XAML/Silverlight 4.0复杂表单字段绑定
我在Silverlight中有一个datagrid,以下字段绑定到XAML/Silverlight 4.0复杂表单字段绑定,xaml,silverlight,data-binding,silverlight-4.0,Xaml,Silverlight,Data Binding,Silverlight 4.0,我在Silverlight中有一个datagrid,以下字段绑定到lastPrice: <data:DataGridTextColumn Header="Last Price" SortMemberPath="lastPrice" Binding="{Binding lastPrice}" IsReadOnly="True"/> 问题是,有时lastPrice小于0,在这种情况下,我希望在字段中显示其他内容(TBD),而不是lastPrice的实际值。有没有一种简单的方法可以在
lastPrice
:
<data:DataGridTextColumn Header="Last Price" SortMemberPath="lastPrice" Binding="{Binding lastPrice}" IsReadOnly="True"/>
问题是,有时lastPrice小于0,在这种情况下,我希望在字段中显示其他内容(TBD
),而不是lastPrice的实际值。有没有一种简单的方法可以在XAML中实现这一点
谢谢 是的,有一种简单的方法可以做到这一点。您可以通过使用