views:

144

answers:

1

I have a user control that has among other things a label AND a textbox control. With this class, I set the textbox to have its modifier as "public", so when I subclass THIS control, I can get directly to the properties and such of the textbox in each instance where needed. No problem.

Now, the problem. I do the exact same thing but with a dataGridView control (and some others) within a user control. Set ITs modifier to public with intent to derive this user control downstream. Now, I try to derive this control to a NEW control and can't directly touch the dataGridView and add columns, sizing, etc directly.

A: 

I tried reproducing the described behavior and was able to do so with the GUI designer in VS 2008 using .Net 3.5. I suspect you are running into the same issue as this problem

That means to get the desired behavior you may need to implement a custom designer. There is even an example designer given by another person answering the question. Please have a look and see if that helps.

Jason D
Thanks for the confirmation that I'm not going nuts. My work-around was the rest of the common class elements are fine, only the DataGridView. So, I've just hard-coded the adding of columns / types and the rest works fine. So for now, I'll leave well-enough alone. Thanks for the support link too.
DRapp
@DRapp, NP. To be honest I was skeptical when I read your question, and appalled when I tried it and saw the described behavior... If I ever come up with a slick way of doing what you want i'll post the code.
Jason D