C# visually subclass datagridview control VS2005

Posted by DRapp on Stack Overflow See other posts from Stack Overflow or by DRapp
Published on 2010-04-07T20:08:26Z Indexed on 2010/04/07 23:33 UTC
Read the original article Hit count: 340

Maybe its something stupid, but I'm having a problem with a subclass of a DataGridView Control in VS2005 C#. I know I can subclass from almost anything by doing

public class MyDataGridView : DataGridView
{}

no problem, and I put in some things / elements I want applicable globally. Now, I take this gridview and put into a custom user control that will contain other controls too. So I have something like created by the visual designer. I grab some buttons, label, and my derived "MyDataGridView" on it.

public partial class MyCompoundDGVPlus : UserControl

So, now, I can visually draw, move, change all sorts of settings as needed, no problem.

Now, I want this "MyCompoundDGVPlus" class as the basis for other classes, of which I will manipulate settings specific, but want all to have the same look / feel, and otherwise similar flow, hence the derivations.

I've even set the "modifiers" setting to public, so I SHOULD be able to modify any of the properties of the controls at any derived level. So, now, I create a new subclass of "MyFirstDetailedDGVPlus" derived from "MyCompoundDGVPlus". Ok visually, all the label, button, datagridview appear. However, now I want to specifically define the columns of the datagridview here in this class visually, but its locked. However, the LABEL on the form, I CAN get all the property settings....

What am I missing.

© Stack Overflow or respective owner

Related posts about c#

Related posts about subclass