2

I created a Generic User Control with following signature..

public partial class GridMastercontrol<TMainEntity, TChildEntity> : UserControl
where TMainEntity : class
where TChildEntity : class
{
// more code here
}

A reference is created as follows-

GridMastercontrol<STACS.ACASupp,STACS.ACALot> ctrl=
                 new GridMastercontrol<STACS.ACASupp,STACS.ACALot>();

The control works perfectly on run-time. But, when i open the designer the design is not displayed and the following two warnings popup-

Warning 1- Could not find type 'WindowsFormsControlLibrary1.GridMastercontrol'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built using settings for your current platform or Any CPU.

Warning 2- The variable 'ctlMasterACA' is either undeclared or was never assigned.

It was working perfectly in design mode when i did not implement the generics concept into it. but now, it does not. :(

Please help me.. Thanks in advance :)

Ankit Goel
  • 353
  • 1
  • 4
  • 13
  • Have you checked if the generics were implemented in all files?? That's a partial class, so it's declared in more than one file. – Daniel Möller Apr 02 '13 at 20:03
  • And see if this is helpful: http://stackoverflow.com/questions/395321/is-it-possible-to-make-a-generic-control-in-net-3-5?rq=1 – Daniel Möller Apr 02 '13 at 20:06