views:

972

answers:

2

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...
A: 

Try deriving the user control from the DevExpress grid control instead of the 'UserControl' class.

Frans Bouma
Yes, I can do that and that's working but, but idea is to have user control where I can put some extra controls (like labels) where I can show extra details about rows in grid (rows count, errors if any etc.). Thanks for your reply and time.
ITGoran
A: 

Solution can be founded here:

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

ITGoran