Support for Generics in Forms and Controls

  • Thread starter Thread starter Chuck Cobb
  • Start date Start date
C

Chuck Cobb

I just discovered the hard way that the Visual Studio designer for forms and
controls does not support generics.

I created the following controls:

Base Class:
public partial class CtlDataGrid<CollectionClass, InfoClass> : CtlBase
where CollectionClass : BaseCollection<InfoClass>
where InfoClass : BaseInfo
{

Primary Class:
public partial class CtlConsultantDatabase :
CtlDataGrid<ConsultantCollection, ConsultantInfo>

Everything works fine...the application compiles and runs fine, but when I
attempt to open the primary control in the designer, I get an error that
says the base control cannot be built.

Is there a work-around for this problem? Is there a plan to support
generics with forms and controls in the future?

Thanks,

Chuck Cobb
 
Hi Chuck,

You can search the MSDN Product Feedback center to find out whether this
issue is already registered in Microsoft's product bug database:

http://lab.msdn.microsoft.com/productfeedback/

If there's no such issue on file, and you do believe this is a bug, you can
submit it there.
 
Yeah, I met the same problem.

It seems that the form designer doesn't support generic.

when use generic in a form class, compile and run is ok, but it can not be
designed.
 
Yeah, its big problem, we have to take completely different approach (much
worse) because of this. I tried "hack" by renaming base classes whenever I
want to go to design but it is just not worth the effort (although "worth"
here means a lot). Did anyone got response from MS, is there
some workaround for this?
 
Yeah, its big problem, we have to take completely different approach (much
worse) because of this. I tried "hack" by renaming base classes whenever I
want to go to design but it is just not worth the effort (although "worth"
here means a lot). Did anyone got response from MS, is there
some workaround for this?



--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top