Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top