I have three GroupBoxes stacked on each other in a Usercontrol.
One docked top, another bottom and last one docked to fill using the Control's dock property.
I am having a hard time getting the autohide behavior from happening. When I collapse the top groupbox control, for example, I was expecting the middle one (which has fill dockstyle) to move up and occupy the space. Instead. I find the top groupbox control collapses leaving an empty background while the middle one stays put.
What am I doing incorrect that is keeping the autosize from happening ? Is there something on the GroupBox I need to do?Or is there something on the UserControl that I am not setting?
Thanks!
PS: I was talking to one of my colleagues and he said I need to change the height of the groupbox control everytime the user expands/collapses it. This he believes would make the other controls to autosize accordingly.
There are 2 ways you can go about this:
1) Use the UltraExplorerBar control, add 3 groups, and set the Group -> Settings -> Style to ControlContainer. Then you can put any type of control in the Group area of the ExplorerBar, and use the automatic re-sizing that the control provides.
2) Add a TableLayoutPanel to a form with 3 rows and 1 column. Add a UltraExpandableGroupBox to each section of the Column. In the Smart Tab for the TableLayoutPanel, click Edit Rows and Column - and select Rows from the Show dropdown. Set each SizeType to AutoSize. This will create the behavior you are after.
Let me know if this helps,
Thanks
Jason
Hi Jason,
Jason Beres"] 1) Use the UltraExplorerBar control, add 3 groups, and set the Group -> Settings -> Style to ControlContainer. Then you can put any type of control in the Group area of the ExplorerBar, and use the automatic re-sizing that the control provides.
UltraExplorerBar could be an very useful control but the one feature that does not work for me. The expansion of a group at the top causes the groups at the bottom to be pushed out of view (a scroll bar show to let me see the out of view part)
Jason Beres"] 2) Add a TableLayoutPanel to a form with 3 rows and 1 column. Add a UltraExpandableGroupBox to each section of the Column. In the Smart Tab for the TableLayoutPanel, click Edit Rows and Column - and select Rows from the Show dropdown. Set each SizeType to AutoSize. This will create the behavior you are after.
The TableLayoutPanel is a good one too but same problem. When I expand one of the top UltraExpandableGroupBox, the lower one is pushed out of view.
Here's what I am trying to achieve a, b,c and d:
a. Three grids stacked on top of each other
b. I want to be able to expand and collapse the top and the bottom one. The middle one is the fill and does not have an expansion/contraction ability. So when the top/bottom expand/collapse, the middle one shrinks/expand to accomodate.
c. That way the total display remains unchanged. Irrespective of what is contracted/expanded, at any point of time, one will see the expansion/collapse icon for all three grids.
d. An additional requirement I did not state earlier is the ability to manually resize the height of top and bottom grids (these grid are docked top and docked bottom). I could achieve resize height ability by placing two splitters between the three grids and have the splitters docked top and bottom resp. This gave me the height resize ability but the problem was when I collapsed the groupbox holding the grid, the splitter and groupbox below/above it stayed put
I am awaiting your suggestions.
PS: After writing that long post, I found that the groupbox does infact do what I want it do using the splitter as explained in d) above. There was some problem with my original prototype which made me post the question. So now problem solved!! The only question I have now is that my middle groupbox has the expansion indicator turned off. That works well but when I apply the stylesheet (corporate standard), the expansion indicator shows!! What do I do? Thanks!
Hello,
Set the ExpansionIndicator to "None" after you apply your stylesheet so that it overwrites the settings, if any, made by the stylesheet that causes the expansion indicator to show.
-Taz.