首页 > 其他分享 >wpf 报错 System.ArgumentException:““{0}”不是 Visual 或 Visual3D。”

wpf 报错 System.ArgumentException:““{0}”不是 Visual 或 Visual3D。”

时间:2022-11-25 12:33:40浏览次数:38  
标签:Visual3D 绑定 System DataGrid 报错 ArgumentException

通常发生于 DataGrid 的自定义模版列(DataGridTemplateColumn)中.

仔细检查是否使用了 <TextBlock> + <Run> 来显示绑定的内容,并且没有指定其绑定模式为单向(OneWay).

如果有这种情况,那么试试将其设置为单向绑定.

 

注意,错误发生时正在操作的列不一定是问题所在列,

比如 DataGrid 一共有30列,你在操作第1列时发生错误,但也许上述错误是发生在第26列.所以每一列都要仔细检查.

标签:Visual3D,绑定,System,DataGrid,报错,ArgumentException
From: https://www.cnblogs.com/8u7tgyjire7890/p/16924740.html

相关文章