Hi,
I have a couple of custom controls which I am looking to create Designers for. I want to be able to drag and drop controls on to UltraPanel(s) contained with in the custom controls, can someone give me the code to do this. I have tried the following but it does not seam to work as the controls are not added to the ClientArea.
namespace DesignTestForm
{
public class CheckBoxGroupBoxDesigner : ParentControlDesigner
public CheckBoxGroupBoxDesigner()
}
public override void Initialize(IComponent component)
base.Initialize(component);
CheckBoxGroupBox checkBoxGroupBox = Control as CheckBoxGroupBox;
if (checkBoxGroupBox == null)
return;
UltraPanelClientArea ultraPanelClientArea = checkBoxGroupBox.ClientArea;
EnableDesignMode(ultraPanelClientArea, "ClientArea");
Okay, so you essentially need your UserControl to be a container, but limit where the user can place items within that container. If you have a subscription to Infragistics that includes source code, you could use one of our control designers as an example. For example, UltraExplorerBar does this, becuase some of it's groups can be containers while most are not.So if you have the source code, you could use UltraExplorerBarDesigner as a reference.
You are on the right track deriving your designer from ParentControlDesigner. But I think there's a lot more to it. We actually have an UltraParentControlDesigner in our design assembly which handles some of this for us, but I think it might require the control to be an UltraControlBase, so I don't know if you could use it for your control.
If you don't have the source, then I'm afraid this question is a bit outside the scope of our support. The question really isn't specific to UltraPanel - it applies to any container control. Although, UltraPanel will add some complexity to the situation, since it has multiple levels of containers in itself. So you might be better off searching Microsoft's documentation and see if they have an example on how to have limited container support within a control.
What happens when you try to drop a control into the panel, now? Does it just get parented to something else? You might need to override GetParentForComponent and return the UltraPanel's client area.
They are a controls derived from UserControl with a UltraPanel(s) as child on it.
I'm not sure if this is possible, but can you clarify a little about your custom control? Is this a UseControl with an UltraPanel on it? Or is it a control that derives from UltraPanel?