I wanted to dock a RadPaneGroup programmaticaly from splitContainer1 to splitContainer2.
From your documentation I understood that I had to:
splitContainer1.Items.Remove(group);
splitContainer2.Items.Add(group);
But now I want to set the docking position in splitContainer2 but, since SplitterPosition is read only, can you tell me how to do this?
Thanks!
6 Answers, 1 is accepted
To dock a group or a pane to a specific position you may use the AddItem method of the SplitContainer. In order for it to work you must first remove the group from its old position (like you do in your code) and after that call this method of the other split container. Please note that the splitContainer2 must be already placed in the visual tree of the Docking control in order for this method to work.
Hope this helps.
Miroslav Nedyalkov
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
Yes, I understood how I can move a pane or group from one split container to the other.
My question was how can I specify where it docks after I insert it into the target split container, as is done with the InitialPosition of the split container on XAML:http://www.telerik.com/help/silverlight/raddocking-managing-docking-controls-dynamically.html#Docking_a_Pane_Design-Time
Thanks!
The InitialPosition property takes effect only if the SplitContainer is placed directly inside the Docking control. If I understand you correctly you need to place a group in a SplitContainer. Here you have these options:
- Just add the group to the other container (as you suggested)
- Add the group at a specified index in the container (again using the Items collection)
- Add the group using the compass logic by calling the AddItem method, which allows you to specify where to Dock the group
Best wishes,
Miroslav Nedyalkov
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
Imagine that I just added programmatically the "Server Explorer" Group to the split container.
How can I specify if the Server Explorer is DockedTop, DockedRight or DockedBottom?
Can you give me more information about the compass method?
Thanks!
I took a look at the picture and it looks like it doesn't represent how the Docking control behaves. On the first picture (under which is written DockedTop) the SplitContainer is docked to the left, on the second one (DockedRight) the container is docked to the Top and the last one (DockedBottom) the container is docked to the right. Please let me know if I misunderstood the picture.
The AddItem method (which uses the compass logic) could be used to place a pane or a group or a SplitContainer relatively to a SplitContainer or Group which is already contained in a SplitContainer which is in the Docking control. The parameter is the relative position to which the new item will be added. Left means that it will placed at the left side of the target, Right - to the right and etc., exactly the same as you drop the dragged item to the respective compass item.
Hope this information is helpful.
Miroslav Nedyalkov
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
Yes, the printscreen wasn't very correct, I copied the images from your documentation but the titles were the ones below the pictures which correspond to next topic in the article.
I finally found the AddItem method and yes it does exactly what I wanted!
Thank you very much!