Last post Dec 04, 2010 12:37 AM by jkirkerx
Nov 03, 2010 04:44 AM|dhonuevo|LINK
I have a custom Panel with attribute Designer(typeof(xxxMainPanelEditor), typeof(System.Web.UI.Design.WebControls.PanelContainerDesigner)).
The child controls of this custom Panel Control at design time can see all the exposed properties that I want to share from the Parent (no problem here).
However, if I place controls on an UpdatePanel, these child controls cannot see the parent container but instead, it immediately sees the form/page or DesignerHost. The problem is the same even if I put Panel on the UpdatePanel and vise versa.
Is there a way to manage controls inside an update panel? For me, this behavior is like saying that UpdatePanel is not container based during design time?
Nov 05, 2010 03:10 AM|Qin Dian Tang - MSFT|LINK
Not quite sure what you mean. Do you have any code? Or you can post it to Ajax forums.
Nov 05, 2010 03:29 AM|mnemukula|LINK
Please give more details on what the child controls are and what the parent is. Please also elaborate what are you
trying to do here as it is not obvious or your explanation isn't very clear.
Nov 06, 2010 01:09 AM|dhonuevo|LINK
Thank you for your interest to assist. I will try to explain a bit more in details.
I need a custom parent control which contains a property that I need to expose to the custom child controls during design time. For simplicity, lets call the property of the parent control as UserGroup.
During design time, the UserGroup property contains a dropdown list of User Groups. This property dropdown works fine in either custom panel or cusom update panel wherein the developer can select the target group in the property window (form design time).
Let's say the developer selected "Group1".
When the developer drags a control to the parent control from the toolbox, lets say custom dropdownlist control, the dragged child control should look to the parent control's UserGroup property to construct the list of Users based on the selected group.
If I use custom panel, the child custom control can see the parent either by this.Parent or ISite.Container. However, if the parent is a custom update panel, the child controls cannot see the update panel. The parent of the child control is Form.DesignerHost.
Please let me know if I was able to share my problem clearly. If not, I will try to make a simple code for my custom controls and send you.
Please also take note that my problem is on Design Time.
Thank you very much.
Nov 06, 2010 08:24 PM|jkirkerx|LINK
Sounds like a public private thing to me. Properties can be made private to the class, or public so it can be accessed outside the class.
Nov 06, 2010 10:12 PM|dhonuevo|LINK
I'm definitely certain that the property is public. In fact, I am using the same child control (custom textbox) which works when dragged into a custom Panel. However, when I drag the said control to a custom UpdatePanel, the child control cannot see the
container parent but instead, it sees the Web.Form.DesignerHost immediately.
By the way, here are some additional info:
When I created the custom Panel, I used the attribute [Designer(typeof(System.Web.UI.Design.WebControls.PanelContainerDesigner))]
The custom Updatepanel is however with the attribute [Designer(typeof(System.Web.UI.Design.UpdatePanelDesigner))]
After reading MSDN, it seemd that the class UpdatePanelDesigner is not indeed derived from a container control:
Is my understanding correct?
Thanks in advance.
Nov 08, 2010 12:03 AM|jkirkerx|LINK
yes your right.
Somethimes, you have to import for both design and runtime. For example System.Drawing.Design. You have to import it for certain property features to work in design mode.
Keep in mind that you have to create 2 programs. 1 for runtime and 1 for design in design view. you have to fork out which mode will run when the control is loaded up in either design mode, or runs in production mode.
I have recent examples if you click on my name.
Nov 09, 2010 01:50 AM|dhonuevo|LINK
How can I escalate this query to microsoft guys?
I really need help on this matter....
Nov 14, 2010 12:24 AM|jkirkerx|LINK
You can't escalate to microsoft. Your idea or goal is on the edge of this forum, in terms of someone willing to give up some knowledge that may be considered secret sauce.
I read the post again, thats very sophisticated. I don't have an anwser now. I'll have to think about about it for awhile. But I will thow out some buzzwords, control collection of propeties, an enumerator of values to select from.
You should rethink the level of sophistication to just get it working working for now, and then excute the grand scheme in the next rewrite of the program, unless it's a commercial job and a customer requirement.
The updatePanel is a runtime control, that provides the ability to simply update a small portion of code inside the contenttemplate.
so instead of the whole page making a round trip, just the contents inside the container get updated.
Just skip the update panel in the design mode part of the control, and produce a design view good enough for the developer to customized. Remember in design mode, the program does not have to run, you just need to customize it
There 2 seperate programs, design and runtime.
Nov 15, 2010 02:50 AM|dhonuevo|LINK
You're suggestion is what I found as a work around - I am putting updatepanels after the design time.
Im not yet sure if our users will accept this idea but this is the only choice I have (I guess).
Just to share you what we're building... We have hundreds if not more than a thousang of form templates to create and Im building reusable sections (user/custom controls) which users can just drag and drop in their forms. The users by the way are not programmers,
but business analysts who are not familiar with c# codes. The form templates' idea was derived from xforms' concepts.
Thanks a lot for your willingness to help. More power to you...
Nov 17, 2010 09:55 PM|jkirkerx|LINK
I doubt if the users will ever even know. So you have to build 2 programs. After that, it should be pretty cookie cutter for the rest.
Let me know how it works out for yah!
Dec 04, 2010 12:37 AM|jkirkerx|LINK
how bout making your post green and closing it out