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

Problem adding RadDocumentPane to RadPaneGroup

2 Answers 100 Views
Docking
This is a migrated thread and some comments may be shown as answers.
C Bates
Top achievements
Rank 1
C Bates asked on 08 Jan 2010, 06:22 PM
UPDATE:
It seems multiple objects can't have the same name if they will be added to a Telerik collection.
In our application, the content we added to the RadDockingPanes included a canvas, and the Canvas object was getting the same name for each pane.
    newCanvas.Name = CanvasName;
When I removed that, it works as expected.

Hello,
Using the Q3 release.  In my xaml I have
    <docking:RadDocking x:Name="Docking" Grid.Row="1" > 
        <docking:RadSplitContainer x:Name="dockLeft" > 
            <docking:RadPaneGroup x:Name="toolsGroup" > 
                <docking:RadPane IsPinned="False" IsHidden="False" CanDockInDocumentHost="False"
                            <!-- stuff --> 
                </docking:RadPane> 
                <docking:RadPane IsPinned="False" IsHidden="False" CanDockInDocumentHost="False" CanUserClose="False"
                </docking:RadPane> 
            </docking:RadPaneGroup> 
        </docking:RadSplitContainer> 
        <docking:RadDocking.DocumentHost> 
            <docking:RadSplitContainer x:Name="splitContainer1"
                <docking:RadPaneGroup x:Name="mapGroup" > 
                </docking:RadPaneGroup> 
                <docking:RadPaneGroup x:Name="rightMapGroup"
                </docking:RadPaneGroup> 
            </docking:RadSplitContainer> 
        </docking:RadDocking.DocumentHost> 
    </docking:RadDocking> 
 
In code I try to add RadDocumentPanes.
            RadDocumentPane newPane = new RadDocumentPane(); 
            newPane.Header = new TextBlock() { 
                Text = "Header" 
            }; 
            newPane.Content = new TextBlock() { 
                Text = "Content" 
            }; 
            newPane.CanFloat = false
            newPane.CanDockInDocumentHost = false
            newPane.CanUserClose = false
 
            mapGroup.Items.Add(newPane); 
 

For the simple content shown above, this works as expected, for as many panes as I want to add.
However, with more complicated content:
Grid
-- Grid
---- StackPanel
---- Canvas
---- ScrollViewer
---------- Canvas
---------- Slider
etc.
The first pane adds as expected, but trying to add a second pane throws this exception:
Value does not fall within the expected range.

What am I doing wrong?
(mapGroup.AddItem(newPane, DockPosition.Left)  works as expected, but that is not what I want.)

Thanks for the help...

2 Answers, 1 is accepted

Sort by
0
C Bates
Top achievements
Rank 1
answered on 10 Jan 2010, 02:25 PM
Solution is in UPDATE in original post.
(I was looking for the option to mark this question as answered...)
0
Edward
Top achievements
Rank 1
answered on 06 Jul 2010, 08:23 PM

Is this being done in code behind? 

If this was done in a viewmodel then how would you get a reference for the RadPaneGroup element -- mapGroup? 
Tags
Docking
Asked by
C Bates
Top achievements
Rank 1
Answers by
C Bates
Top achievements
Rank 1
Edward
Top achievements
Rank 1
Share this question
or