Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Docking > Drag Drop defaults to hardcoded size

Not answered Drag Drop defaults to hardcoded size

Feed from this thread
  • Mark avatar

    Posted on Jan 24, 2012 (permalink)

    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?

    Reply

  • Konstantina Konstantina admin's avatar

    Posted on Jan 27, 2012 (permalink)

    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 >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Docking > Drag Drop defaults to hardcoded size
Related resources for "Drag Drop defaults to hardcoded size"

Silverlight Docking Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]