Hi there,
I'm currently working on a Visual Studio .NET 2005 Winforms project, where i've got multiple forms which have a DataGridView on it. So I decided, for maintenance sake, that I had to create a baseform, since alle the forms really must look-a-like. In the baseform I've set the modifier of the, to be inherited, control to public or protected. Nice job you would think! But guess again, cause visual inheritance on 2.0 controls, that can hold a collection, like the DataGridView is not possible. So you can throw away all your good meanings and efforts!
This is what Microsoft has to say about it:
"We disabled this scenario intentionally. We chose to not make the
engineering effort it would have required to enable this scenario for
Whidbey. This decision was not make lightly and we understand customers
would like this functionality, but the existing visual inheritance
architecture in combination with collection based controls makes it
extremely costly to address. We hope to enable this in future versions".
So I checked if they already fixed this in Visual Studio .NET 2008, cause that would again be one reason to move over to Visual Studio 2008. And guess what! Microsoft did NOT change it in this release.It doesn't matter if you target your application to the .NET framework 2.0 or even 3.5. I'll guess I just have to get used to the fact that this, in my opion very important feature, is just the way it is.
The question remains: Do you still use inheritance for the DataGridView control on the baseform, and add the stuff you want in code? Or ignore inheritance for this control and add a DataGridView control to each form?
You can read more about it here:
Form designer doesn’t allow to modify properties of all new for .Net Framework 2.0 controls
Can't Modify Inherited ListView Any Longer
VS2005 Beta 2 Designer not allow to modify/access MenuStrip control in inherited Windows Form
Hope this is usefull!
gr,
Robbert