【发布时间】:2012-06-07 15:05:03
【问题描述】:
目前我有以下内容:
<DataGridTextColumn Header="Customer Name"
x:Name="columnCustomerSurname"
Binding="{Binding Path=Customer.FullName}" SortMemberPath="Customer.Surname"
IsReadOnly="True">
</DataGridTextColumn>
其中Customer.FullName 定义为:
public string FullName
{
get { return string.Format("{0} {1}", this.Forename, this.Surname); }
}
绑定有效,但并不理想。
如果有人更新 Forename 或 Surname 属性,则更新不会反映在 DataGrid 中,直到它被刷新。
我发现了类似的问题,例如https://stackoverflow.com/a/5407354/181771 使用 MultiBinding 但这适用于 TextBlock 而不是 DataGrid。
我还有其他方法可以让它工作吗?
【问题讨论】: