I have several controls that follow a similar pattern and require the same resizing logic. I am using the XPPanel controls from this Code Project Full-featured XP Style Collapsible Panel
So my approach is to create a derived control from the XPPanel control that has several containers and a DataGridView control. The Hierarchy of the derived control will be:
2 Collapsible Group Box - Search Criteria
2 Group Box - Results
3 Panel for buttons
3 Collapsible Group Box - Details for selected grid control
The sizing algorithm is to adjust the size of the datagridview based on the size of the XPPanel (Driven by monitor resolution and user sizing) and the other group boxes and panel. The goal is to balance the amount of rows visible against the amount of details that can be seen without having to scroll the window.
I want this to be a control that I can derive each of the specific controls from so I can have this class handle the resizing logic and setting the scrolling min sizes.
So my idea was to create the derived class for each of the final controls and then fill the group boxes and the Panel with the appropriate controls for that specific control.
I did something similar when I created a Dialog Control that was derived from a form control and contained the OK and Cancel button. Then I derived the actual dialog boxes from this control.
The problem I am running into is when I try to create a control derived from XPPanel the designer screen does not let me place the group boxes, panel and datagridview so they display as they would at run time. Instead I just get an icon and text that represent the control.
Is what I am trying to do possible?
Can someone suggest a better way to resolve the problem?
Should I be using Layout Controls?
Some more Details:
I am using VS 2005