Enable design time support for UserControl in VisualStudio 2008
-
22-08-2019 - |
Question
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...
Solution 2
Solution can be founded here:
OTHER TIPS
Try deriving the user control from the DevExpress grid control instead of the 'UserControl' class.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow