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

Accessing second SplitContainer

1 Answer 44 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Achim
Top achievements
Rank 1
Achim asked on 21 Aug 2013, 09:48 AM
Hello there,

is it possible to access a second SplitContainer in MVVM pattern in the ViewModel which is not the DocumentHost and add new Panes to it ? I have 2 Panes to search for Documents in a SplitContainer and want to re-add them to it in case that they have been closed by the user. The first SplitContainer contains the searchresults, which are editable, this is why that one is the DocumentHost. I can access the RadDocking in the ViewModel, which is passed to it as a CommandParameter. Thank you for your help!

Regards,
Achim

1 Answer, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 26 Aug 2013, 07:29 AM
Hello,

I am not sure I understand the exact scenario in your project. But you could access the SplitContainers that are declared in the Docking control with the use of the ChildrenOfType<RadSplitContainer>() method. The next code snippet shows how to add a Pane to the first SplitContainer of the Docking control with the previously mentioned approach:
RadPane radPane = new RadPane() { Title = "New sample RadPane" };
radPane.Content = new TextBox() { Text = "TextBox" };
var splitContainers = this.Docking.ChildrenOfType<RadSplitContainer>().ToList<RadSplitContainer>();
var paneGroup = splitContainers[0].Items[0] as RadPaneGroup;
paneGroup.Items.Add(radPane);

Hope this is helpful. If I have missed something could you try to reproduce the issue in a sample project and send it to us in a support ticket in order for us to observe the exact scenario on your project.

Regards,
Vladi
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Docking
Asked by
Achim
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Share this question
or