C1DashboardLayout type "Split": container with three or more panels

Posted by: wknauf on 30 August 2024, 8:53 am EST

    • Post Options:
    • Link

    Posted 30 August 2024, 8:53 am EST - Updated 30 August 2024, 8:58 am EST

    Hi C1,

    the “C1SplitContainer” has the ability to add more than two “C1SplitterPanel”, and I like this feature, because we can easily create a “three columns, two rows” C1Dashboard layout by adding three splitter panels to the root splitcontainer, each dock = “Left”. For each splitter panel, I add another splitcontainer with two splitter panels and dock = “Top”.

    This results in a layout like this:

    Now, when you start attached sample (also posted in another thread, the relevant part is in “FormSplit.cs”, I use two cols and three rows here), you will see that the first panel has a width/height of 50%, the second and third panel are at 25%. I would expect them all to be at 33%.

    DashBoardTest.zip

    There is a property “C1SplitterPanel.SizeRation”, but I set it to “0.33” in my sample, the result is horrible: panels 1 and 2 have a height of 0, panel 3 has the full height.

    Do you have an idea? Can I set the ratio for the splitter panels? I would prefer that you say “this is a bug” ;-).

    Best regards

    Wolfgang

  • Posted 2 September 2024, 5:12 am EST

    Hello Wolfgang,

    The definition of the SizeRatio property is: Gets or sets the size of a panel as percentage of the whole remaining area.

    This property accepts values from 1 to 100 and adjusts the panel’s size relative to the remaining available space. For instance, if there are three panels and you set the SizeRatio to 33 for the first panel, the size for the second panel will be calculated based on the space that remains after the first panel’s size has been allocated.

    Please note that the last panel always fills the remaining area.

    Please refer to the attached modified sample, DashBoardTest_Mod2.zip, in which we have set SizeRatio as 33 for the first panel and 50 for the second so that all of the panels get equal height in the container.

    Regards,

    Uttkarsh.

  • Posted 2 September 2024, 2:48 pm EST

    OK, I get it.

    Four panels: 25 / 33 / 50 / 50 (the ratio of the final panel does not matter probably or could be set to 100 to complete the series)

    Five panels: 20 / 25 / 33 / 50 / 50

    Six panels: 16 / 20 / 25 / 33 / 50 / 50

    Is this correct? At least it worked for me.

    Best regards

    Wolfgang

  • Posted 3 September 2024, 6:22 am EST

    Hello Wolfgang,

    Indeed, this is correct.

    You can even generalize it as: SizeRatio(i) = 100/(n-i+1), where n<=i<=1

    SizeRatio(i) → SizeRatio of i-th panel

    n → total panels

    Regards,

    Uttkarsh.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels