all groups > dotnet windows forms designtime > april 2006 >
You're in the

dotnet windows forms designtime

group:

Support for Generics in Forms and Controls


Support for Generics in Forms and Controls Chuck Cobb
4/13/2006 2:34:45 PM
dotnet windows forms designtime: 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

Re: Support for Generics in Forms and Controls gxtsh75
4/15/2006 6:15:27 PM
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.

"Chuck Cobb" <chuck_cobb@oxfordcorp.com> дÈëÏûÏ¢
news:O7$FyjyXGHA.4688@TK2MSFTNGP04.phx.gbl...
[quoted text, click to view]

Re: Support for Generics in Forms and Controls A.Cicak
4/16/2006 12:00:00 AM
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?



--
----------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 542 spam emails to date.
Paying users do not have this message in their emails.
Try www.SPAMfighter.com for free now!

Re: Support for Generics in Forms and Controls A.Cicak
4/16/2006 12:00:00 AM
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?

Re: Support for Generics in Forms and Controls A.Cicak
4/16/2006 12:00:00 AM
Sorry for 2 posts, now I see I have problems with mail client...

[quoted text, click to view]

AddThis Social Bookmark Button