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

Changing DockSate Programatically

3 Answers 91 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Brian Henry
Top achievements
Rank 1
Brian Henry asked on 02 Jul 2010, 11:19 PM
I am having trouble setting the DockState of a RadSplitContainer in code.

 

 

<telerikDocking:RadDocking x:Name="docking" HasDocumentHost="False" Grid.Row="1">

 

 

 

    <telerikDocking:RadSplitContainer x:Name="dockSplit" Orientation="Vertical" InitialPosition="{Binding DispatchSettings.DispatchIniPos, Mode=TwoWay}">

 

 

 

<telerikDocking:RadPaneGroup x:Name="groupPaneDispatch">

 

 

 

<telerikDocking:RadPane x:Name="paneDispatch" CanUserClose="False" CanUserPin="False" PaneHeaderVisibility="Collapsed">

When the user presses a button I want to toogle between DockedTop and DockedLeft as in the following button handler:

 

 

private void btnXyz_Click(object sender, RoutedEventArgs e)

 

 

{
    if (cond)
    {
        RadDocking.SetDockState(dockSplit, Telerik.Windows.Controls.Docking.DockState.DockedLeft);

 

 

 

    }
    else
    {
        RadDocking.SetDockState(dockSplit, Telerik.Windows.Controls.Docking.DockState.DockedTop);

 

    }
}
Unfortunately, this code does ot work unless I put it on the constructor.  How can I set the DockState programatically?

Thank you,
Brian

3 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 07 Jul 2010, 05:18 PM
Hi Brian,

 The InitialPosition property is used only for initially positioning the SplitContainer. If you want to set its placement after initialization you should use the RadDocking.DockState attached property.

Hope this helps!

Kind regards,
Miroslav Nedyalkov
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Brian Henry
Top achievements
Rank 1
answered on 07 Jul 2010, 05:45 PM
Could you please provide me with an example where you set the docstate programatically after the application has loaded.

Thanks,
Brian
0
Konstantina
Telerik team
answered on 12 Jul 2010, 01:15 PM
Hi Brian Henry,

Thank you for your reply.

You can use the following code-snippet in order to work-around the issue:

dockSplit.SetValue(RadDocking.DockStateProperty, Telerik.Windows.Controls.Docking.DockState.DockedTop);
dockSplit.ClearValue(FrameworkElement.WidthProperty);
dockSplit.ClearValue(FrameworkElement.HeightProperty);

Hope this helps.

If you have further questions please let us know.

Sincerely yours,
Konstantina
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
Docking
Asked by
Brian Henry
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Brian Henry
Top achievements
Rank 1
Konstantina
Telerik team
Share this question
or