While working today I came across a perceived problem with using Visual Inheritance (Windows Forms that inherit from “base” forms). Microsoft has admitted that it is an unsupported scenario:
“Modifying collections, such as the columns in a DataGridView, in inherited forms or controls is currently an unsupported scenario.”
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=284335&wa=wsignin1.0
Fortunately, there is a workaround that seems to fix the problems I have with it.
Create a user control class, and paste the following code:
[Designer(typeof System.Windows.Forms.Design.ControlDesigner))]
public class ucInheritedDataGridView : DataGridView { }
Now refer to ucInheritedDataGridView every where you would have an inherited DataGridView.

February 21, 2009 at 9:22 pm
Dear Mr. Ryan,
First of all, THANK YOU, that’s a solution for problems – stupid VS (even 2008!) could not support the DataGridView in child form from the parent form.
I present my C++ code of your idea:
[Designer("System.Windows.Forms.Design.ControlDesigner, System.Windows.Forms.Design.DLL")]
public ref class NLCFormDataGridView : System::Windows::Forms::DataGridView {};
It works perfectly! Once again, thank you.
March 31, 2009 at 6:31 am
Humm this doesn’t work for me… not sure why though.
.Net 2.0,
Visual Studio 2008,
Attempting to do this with the DataGridView.
March 31, 2009 at 6:40 am
I spoke to soon, I restarted Visual Studio and boom, it’s working now.
Cheers for the article.
March 31, 2009 at 8:40 am
Glad to hear it worked for you Paul. Thanks for visiting and leaving a comment!
June 17, 2009 at 4:04 am
Brilliant, thanks Brandon! I was just about to give up on inherting from my base form with a DataGridView on it when I found this post. You just made my life a lot easier…