在 VisualStudio 2008 中启用对 UserControl 的设计时支持
我创建了用户控件 GridEx:UserControl。 在该控件上我放置了 GridControl(DevExpress 数据网格控件)。 我创建了返回内部数据网格控件的属性数据网格(之前添加) 如何启用对 DataGrid 的设计支持? 我尝试输入
[Designer("DevExpress.XtraGrid.Design.GridControlDesigner,
DevExpress.XtraGrid.v8.2.Design", typeof(IDesigner))]
但收到此错误: 无法创建组件“DataGridControl”。
错误信息如下:
System.NullReferenceException: Object reference not set to an instance of an object.
at DevExpress.XtraGrid.Design.GridControlDesigner.Initialize(IComponent component)
at System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo)
at System.ComponentModel.Design.DesignerHost.Add(IComponent component, String name)
at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design. IDesignerHost.CreateComponent(Type componentType, String name)
at System.ComponentModel.Design.DesignerHost.System.ComponentModel. Design.IDesignerHost.CreateComponent(Type componentType)
at System.Drawing.Design.ToolboxItem.CreateComponentsCore(IDesignerHost host)
at System.Drawing.Design.ToolboxItem.CreateComponentsCore(IDesignerHost host, IDictionary defaultValues)
at System.Drawing.Design.ToolboxItem.CreateComponents(IDesignerHost host, IDictionary defaultValues)
at System.Windows.Forms.Design.OleDragDropHandler.Cre...
I have created usercontrol GridEx:UserControl.
On that control I putted GridControl (DevExpress datagrid control).
I have created Property DataGrid which return inner datagrid control (previously added)
How to enable design support for DataGrid ?
I try to put
[Designer("DevExpress.XtraGrid.Design.GridControlDesigner,
DevExpress.XtraGrid.v8.2.Design", typeof(IDesigner))]
but I get this error:
Failed to create component 'DataGridControl'.
The error message follows:
System.NullReferenceException: Object reference not set to an instance of an object.
at DevExpress.XtraGrid.Design.GridControlDesigner.Initialize(IComponent component)
at System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo)
at System.ComponentModel.Design.DesignerHost.Add(IComponent component, String name)
at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design. IDesignerHost.CreateComponent(Type componentType, String name)
at System.ComponentModel.Design.DesignerHost.System.ComponentModel. Design.IDesignerHost.CreateComponent(Type componentType)
at System.Drawing.Design.ToolboxItem.CreateComponentsCore(IDesignerHost host)
at System.Drawing.Design.ToolboxItem.CreateComponentsCore(IDesignerHost host, IDictionary defaultValues)
at System.Drawing.Design.ToolboxItem.CreateComponents(IDesignerHost host, IDictionary defaultValues)
at System.Windows.Forms.Design.OleDragDropHandler.Cre...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试从 DevExpress 网格控件而不是“UserControl”类派生用户控件。
Try deriving the user control from the DevExpress grid control instead of the 'UserControl' class.
解决方案可以在这里找到:
http://www.devexpress.com/kb=A577
Solution can be founded here:
http://www.devexpress.com/kb=A577