DataGrid更新数据时报错
更新DataGrid的时候会在控制台报错,调试时打印错误信息耗时导致界面卡顿。
10:53:55:865 System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.DataGrid', AncestorLevel='1''. BindingExpression:Path=FontSize; DataItem=null; target element is 'DataGridRow' (Name=''); target property is 'FontSize' (type 'Double') 10:53:55:865 System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.DataGrid', AncestorLevel='1''. BindingExpression:Path=FontFamily; DataItem=null; target element is 'DataGridRow' (Name=''); target property is 'FontFamily' (type 'FontFamily') 10:53:55:865 System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.DataGrid', AncestorLevel='1''. BindingExpression:Path=FontWeight; DataItem=null; target element is 'DataGridRow' (Name=''); target property is 'FontWeight' (type 'FontWeight') 10:53:55:865 System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.DataGrid', AncestorLevel='1''. BindingExpression:Path=FontWeight; DataItem=null; target element is 'DataGridRowHeader' (Name=''); target property is 'FontWeight' (type 'FontWeight') 10:53:55:865 System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.DataGrid', AncestorLevel='1''. BindingExpression:Path=FontSize; DataItem=null; target element is 'DataGridRowHeader' (Name=''); target property is 'FontSize' (type 'Double') 10:53:55:865 System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.DataGrid', AncestorLevel='1''. BindingExpression:Path=FontFamily; DataItem=null; target element is 'DataGridRowHeader' (Name=''); target property is 'FontFamily' (type 'FontFamily')