1
我有一個WPF datagrid數據綁定到一個collectionviewsource,它本身是基於一個實體查詢Entity Datagrid:添加計算值的最佳方法?
在我的網格例如我有3列1號,2號,3號實體的所有屬性。如果我想添加一個名爲SumNumber的列,它等於Number1 + Number2 + Number3,那麼最好的方法是什麼,以便當我更改Number1時,SumNumber中的值會更新?
在此先感謝
我幾乎沒有,但我發現另一個錯誤。見一個代碼片段
public partial class MyEntity
{
public double MyCustomizedProperty{get;set;}
public MyEntity()
{
this.PropertyChanged += Entity_PropertyChanged;
}
void Entity_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
case "Date" :
MyCustomizedProperty = DateTime.Now.Second;
ReportPropertyChanged("MyCustomizedProperty");
break;
}
}
}
,編譯和所有下方,但是當我改變「日期」我得到一個運行時錯誤:
The property 'SigmaFinal' does not have a valid entity mapping on the entity object. For more information, see the Entity Framework documentation.
我想這是由於該酒店不在OnStateManager中。你能讓我知道如何解決這個問題嗎?
感謝
完美謝謝! – daW0lverine