当我尝试使用 WpfTable.ColumnHeaders 属性获取 DataGrid 上的列标题时,当且仅当网格中的其中一列的可见性设置为折叠时,我得到一个参数异常。
通常:
var columnHeaders = myUiMap.Grid.ColumnHeaders;
会抛出这个异常:
System.ArgumentException: The native object System.Windows.Automation.AutomationElement is not supported by technology manager UIA.
这看起来像是自动化框架中的错误,但我不太确定。你知道为什么会这样吗?
最佳答案
我最终使用了 Visibility.Hidden 而不是 Visibility.Collapsed
关于c# - WPF 编码 UI : ArgumentException when getting ColumnHeaders on a WpfTable if a column is collapsed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26545785/