This is a migrated thread and some comments may be shown as answers.

Assign Proportional widths to a group of RadSplitContainers

2 Answers 292 Views
Docking
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 24 Jul 2015, 11:15 AM

Hi, I have three horizontaly tiled RadSplitContainers inside another RadSplitContainer and I want to set the width of each one in percentage terms for the space available.

For example:

RadSplitContainer1 width should be 2/10 of available horizontal space

RadSplitContainer2 width should be 5/10 of available horizontal space

RadSplitContainer3 width should be 3/10 of available horizontal space

 

I am a bit confused with the documentation on how to achieve this. Anyone to kindly suggest a practical example?

 

Regards,

 

George

2 Answers, 1 is accepted

Sort by
0
George
Top achievements
Rank 1
answered on 24 Jul 2015, 11:27 AM

And since we are at this subject, another more demanding case where the first splitcontainer has a fixed size, while the other two take a proportion of the available left space:

 

RadSplitContainer1 width should have a fixed non changeable width of 250
RadSplitContainer2 width should be 4/10 of the available horizontal space
RadSplitContainer3 width should be 6/10 of available horizontal space​

 I would greatly appreciate a response also to this case.

 

Regards,

 

George

0
Nasko
Telerik team
answered on 27 Jul 2015, 01:24 PM
Hi George,

With the current version of RadDocking setting a fixed size to the Pane or Group is not supported and might lead to some unexpected behavior. Because of that in order to set a size to the Pane we suggest to use the ProportionalStackPanel.RelativeSize attached property.

That panel is provided by the SplitContainer element in the Docking control and it inherits the default WPF panel class. Its RelativeSize property is used to divide the width and height occupied by the RadPaneGroups placed in the same RadSplitContainer. For example if you have two SplitContainers and you want the first one to occupy 1/3 of the available width you need to set the RelativeSize to "200,200" and the second SplitContainer should have size "400,200" - thus it will occupy the remaining 2/3. The same is also valid if you want to divide the height - 400 indicates the width of the size and 200 is the height.

Please, check the attached sample project that demonstrates how achieve the desired by you sizing of the SplitContainers and let us know if it worked for you.

Hopes this helps.

Regards,
Nasko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Docking
Asked by
George
Top achievements
Rank 1
Answers by
George
Top achievements
Rank 1
Nasko
Telerik team
Share this question
or