相关疑难解决方法(0)

WPF DataBinding错误:找不到引用'RelativeSource FindAncestor'的绑定源

我从下面的代码中得到以下错误...不确定为什么(是的,它产生所有4,即使它是相同的2重复).哦,它并没有产生交替的行效果,即使在这些错误出现之前,相同的代码正在运行.

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.DataGrid', AncestorLevel='1''. BindingExpression:Path=AreRowDetailsFrozen; DataItem=null; target element is 'DataGridDetailsPresenter' (Name=''); target property is 'SelectiveScrollingOrientation' (type 'SelectiveScrollingOrientation')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.DataGrid', AncestorLevel='1''. BindingExpression:Path=HeadersVisibility; DataItem=null; target element is 'DataGridRowHeader' (Name=''); target property is 'Visibility' (type 'Visibility')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.DataGrid', AncestorLevel='1''. BindingExpression:Path=AreRowDetailsFrozen; DataItem=null; target element is 'DataGridDetailsPresenter' (Name=''); target …
Run Code Online (Sandbox Code Playgroud)

data-binding wpf wpfdatagrid

10
推荐指数
1
解决办法
7474
查看次数

标签 统计

data-binding ×1

wpf ×1

wpfdatagrid ×1