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

Drag Drop defaults to hardcoded size

1 Answer 63 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 24 Jan 2012, 05:45 PM
I have a RadDocking control layed out with two rows(showing the serialized layouot) that are set with relative size(percentage based)
.
<RadSplitContainer Dock="DockedLeft" Orientation="Vertical">
    <Items>
      <RadSplitContainer RelativeWidth="400" RelativeHeight="200">
        ....        
    </Items>
      </RadSplitContainer>
      <RadSplitContainer RelativeWidth="400" RelativeHeight="200" Orientation="Horizontal">
        <Items>
          ....            
        
</Items>
          </RadSplitContainer>
        </Items>
      </RadSplitContainer>    
    </Items>
  </RadSplitContainer>

When a user drags a RadPaneGroup to the root(top) it will always create a RadSplitContainer with a hardcoded height. example below.
Note* notice the Height="180"
<?xml version="1.0" encoding="utf-8"?>
<RadDocking>
  <SplitContainers>
    <RadSplitContainer Dock="DockedTop" Height="180" RelativeWidth="100" RelativeHeight="100" IsAutoGenerated="True">
      <Items>
        <RadPaneGroup RelativeWidth="100" RelativeHeight="100" IsAutoGenerated="True" SelectedIndex="0">
          <Items>
            <RadPane SerializationTag="TileId=4" IsHidden="False" IsDockable="True" Title="" Header="" />
          </Items>
        </RadPaneGroup>
      </Items>
    </RadSplitContainer>
    <RadSplitContainer Dock="DockedLeft" Orientation="Vertical">
      <Items>
              .....    
    </Items>
    </RadSplitContainer>
  </SplitContainers>
</RadDocking>

I need to keep everything relative. How do we change the behavior so RadDocking  does not use hardcoded sizes?

1 Answer, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 27 Jan 2012, 09:46 AM
Hi,

You could use the IGeneratedItemsFactory to create custom SplitContainers with specific properties set. You could find an example of its use here. It illustrates its implementation for creating custom ToolWindows. First, you need to create new class which inherits DefaultGeneratedItemsFactory and override the CreateSplitContainer method, for example:

public class GenerateSplitContainer : DefaultGeneratedItemsFactory
        {
            public override RadSplitContainer CreateSplitContainer()
            {
                return new RadSplitContainer { Width = 200, Height = 200 };
            }
        }

And then set the new items factory to the Docking control:

<telerik:RadDocking>                     
                <telerik:RadDocking.GeneratedItemsFactory
                    <local:GenerateSplitContainer /> 
                </telerik:RadDocking.GeneratedItemsFactory
....... 
</telerik:RadDocking>

Hope this helps. Please do not hesitate to contact us again if you have further questions.

Kind regards,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
Docking
Asked by
Mark
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Share this question
or