繁体   English   中英

在Visual Studio 2008中为UserControl启用设计时支持

[英]Enable design time support for UserControl in VisualStudio 2008

我已经创建了usercontrol GridEx:UserControl。 在该控件上,我放入了GridControl(DevExpress datagrid控件)。 我已经创建了Property DataGrid,该属性返回了内部datagrid控件(先前已添加)如何启用对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...

尝试从DevExpress网格控件而不是'UserControl'类派生用户控件。

解决方案可以在这里建立:

http://www.devexpress.com/kb=A577

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM