0

I have a user control and it does not seem to like me using a base class with a type parameter. Is there any way around this/am I missing something?

public partial class PopupSelector : PopupSelectionControl3<int>
{
    public PopupSelector()
    {
        InitializeComponent();
    }
}

... Plus the designer code ...

public class PopupSelectionControl3<TValue> : XtraUserControl
{
}
DmitryG
  • 17,677
  • 1
  • 30
  • 53
William
  • 3,335
  • 9
  • 42
  • 74

1 Answers1

0

The WinForms designer does not cope very well with generic UserControls.

bernhardrusch provides a workaround here

public partial class UserControl : UserControlDesignable  {  ... } 

public class UserControlDesignable : BaseUserControl<Someclass> { } 

More detail on the workaround can be found here

Community
  • 1
  • 1
Laoujin
  • 9,962
  • 7
  • 42
  • 69