[英]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'類派生用戶控件。
解決方案可以在這里建立:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.