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

Setting the docking position programatically

6 Answers 71 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Oscar
Top achievements
Rank 1
Oscar asked on 29 Aug 2011, 03:13 PM
Dear Telerik Team,

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

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 31 Aug 2011, 08:59 AM
Hi Oscar,

 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.

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

0
Oscar
Top achievements
Rank 1
answered on 31 Aug 2011, 02:01 PM
Hi Miroslav and thank you for your reply.

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!
0
Miroslav Nedyalkov
Telerik team
answered on 02 Sep 2011, 11:43 AM
Hello Oscar, 

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
If none of these suggestions help, please explain us in more details what you need to achieve. Some screen shots would be of great help.

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

0
Oscar
Top achievements
Rank 1
answered on 02 Sep 2011, 02:38 PM
Check the attached picture please.

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!
0
Accepted
Miroslav Nedyalkov
Telerik team
answered on 07 Sep 2011, 08:12 AM
Hi Oscar,

 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.

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

0
Oscar
Top achievements
Rank 1
answered on 08 Sep 2011, 11:02 AM
Hi Miroslav,

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!
Tags
Docking
Asked by
Oscar
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Oscar
Top achievements
Rank 1
Share this question
or