0

datagrid对一个简单的 Windows 窗体项目(框架 4.0,VS2010)有疑问。在后面的代码中是无法访问该datagrid.Columns属性的。我是否缺少程序集参考?

这些是我的参考:

Microsoft.CSharp,
System,
System.Core,
System.Data,
System.Data.DataSetExtensions,
System.Data.Entity,
System.Deployment,
System.Drawing,
System.Runtime.Serialization,
System.Security,
System.Windows.Forms,
System.Windows.Form.Ribbon35,
System.xml,
System.Xml.Linq,
WindowsBase,
WPFToolkit.Extended
4

2 回答 2

0

也许我想通了。该属性似乎仅适用于 wpf 组件。实际上,对于 Windows 表单,datagrid 程序集是 System.Windows.Form 而对于 wpf 组件是 PrsentationFramework (System.Windows.Controls)

于 2013-02-23T14:31:38.953 回答
0

我不确定,但我没有看到 System.Windows.Controls,你需要它。

数据网格列的组装:system.windows.controls.datagrid.columns

当您缺少程序集时,我还想建议您Resharper一个非常好的工具。

于 2013-02-21T22:10:44.200 回答