0

我创建了用户控件 GridEx:UserControl。在那个控件上,我放置了 GridControl(DevExpress 数据网格控件)。我创建了返回内部数据网格控件的属性 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...
4

2 回答 2

0

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

于 2009-02-09T09:25:31.493 回答
0

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

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

于 2009-02-24T08:20:14.360 回答