Possibly one of your controls is missing AutoSizeMode =
AutoSizeMode.GrowAndShrink.
Note: The default value of c2.marginCached is Padding.Empty. The value of
marginCached is assigned in the Add(...) method.
If you disable that line, then expanding the checkbox will not increase the
margin. For example, using a big margin like Padding(35), the expanded
control should look like:
With the disabled line, it would look like: [image: Inline image 2]
You should set a breakpoint at the line you commented out and verify that
cachedMargin is not Padding.Empty. I suspect another control inside the
accordion is incorrectly calculating its size, and it is set to not shrink.
I have tried to reproduce the problem but cannot. I've attached some code I
was playing around with to try to reproduce the problem. If you are able to
reproduce the problem using a small example then let me know.
Thanks a lot Opulos, i just want to check if someone is looking into it, as the control (accordion) is really good and i really love it but this issues was killing me, i tried a lot myself as well but was not able to find solution that is why i posted here..
thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I thought I was close to a solution calculating the true available width by subtracting the aggregate margin and padding widths from the the a.ClientSize.Width in the FLP GetPreferredSize(...) method. However, in one case where an Accordion was added to a TableLayoutPanel and that panel was added as a child of another Accordion would need to be adjusted differently depending on the width of its CellBorderLayout property. Having to handle rules for specific controls does not make sense, which means a different approach is needed.
At this point, I'm thinking of replacing the internal host FlowLayoutPanel (FLP) with a simple LayoutEngine specifically designed for the Accordion. This would also have the advantage of ditching the DummyControl, which is a crutch to make the FlowLayoutPanel work.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please try the version just released, v2015.08.03. It should solve your problem. This ticket is closing. If there are any other issues then please start a new ticket. Thanks for your feedback!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
it got resolved resolved after commenting below comment
c2.Margin = (cb.Checked ? c2.marginCached : Padding.Empty);
please suggest
Possibly one of your controls is missing AutoSizeMode =
AutoSizeMode.GrowAndShrink.
Note: The default value of c2.marginCached is Padding.Empty. The value of
marginCached is assigned in the Add(...) method.
public CheckBox Add(Control c, String text, String toolTip = null, double
fillWt = 0, bool? open = null, Padding? contentPadding = null, Padding?
contentMargin = null, Color? contentBackColor = null, Padding?
checkboxMargin = null) {
...
c2.marginCached = Get(contentMargin, ContentMargin);
If you disable that line, then expanding the checkbox will not increase the
margin. For example, using a big margin like Padding(35), the expanded
control should look like:
Add(new TextBox(), "Parent1", contentMargin:new Padding(35));
[image: Inline image 1]
With the disabled line, it would look like:
[image: Inline image 2]
You should set a breakpoint at the line you commented out and verify that
cachedMargin is not Padding.Empty. I suspect another control inside the
accordion is incorrectly calculating its size, and it is set to not shrink.
I have tried to reproduce the problem but cannot. I've attached some code I
was playing around with to try to reproduce the problem. If you are able to
reproduce the problem using a small example then let me know.
Last edit: Opulos Inc. 2015-07-15
Even the test code you provided is increasing size (only first time and never reducing back).
please find the attached screen shots
It looks like you want to use 'accordion.FillWidth = false'. Let me know if that solves your problem.
I am using testing code provided by you.
just modified it to make accordian dock fill in form.
but i am facing issue is that nested according is showing scrollbar when i increase form's size and reduce it back.
This happens even if i have made autosizemode to grow and shrink.
even if nestedAccordion is blank, same issue..
this happens only if nested accordion is visible on screen
private void Form1_Load(object sender, EventArgs e)
{
List<CheckBox> checkboxList = new List<CheckBox>();
Last edit: Dr. Rajesh Kumar Rolen 2015-07-21
Any one there to help me out ?
A solution is almost ready.
Thanks a lot Opulos, i just want to check if someone is looking into it, as the control (accordion) is really good and i really love it but this issues was killing me, i tried a lot myself as well but was not able to find solution that is why i posted here..
thanks
I thought I was close to a solution calculating the true available width by subtracting the aggregate margin and padding widths from the the a.ClientSize.Width in the FLP GetPreferredSize(...) method. However, in one case where an Accordion was added to a TableLayoutPanel and that panel was added as a child of another Accordion would need to be adjusted differently depending on the width of its CellBorderLayout property. Having to handle rules for specific controls does not make sense, which means a different approach is needed.
At this point, I'm thinking of replacing the internal host FlowLayoutPanel (FLP) with a simple LayoutEngine specifically designed for the Accordion. This would also have the advantage of ditching the DummyControl, which is a crutch to make the FlowLayoutPanel work.
Any good news on this ?
I mean if it is done then please let me know, i am desparately looking for it.
Please try the version just released, v2015.08.03. It should solve your problem. This ticket is closing. If there are any other issues then please start a new ticket. Thanks for your feedback!
Closed-Fixed.