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

DocumentHost Defect

3 Answers 109 Views
Docking
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 15 Mar 2010, 09:30 AM

Hello,

When creating a floating ToolWindow programmatically the DocumentHost is setting the first DocumentPane to be selected. So if I had a second DocumentPane selected, then opened a ToolWindow, the first DocumentPane would suddenly become selected. For example:

<Grid> 
        <Grid.RowDefinitions> 
            <RowDefinition /> 
            <RowDefinition /> 
        </Grid.RowDefinitions> 
            <Controls:RadDocking> 
            <Controls:RadDocking.DocumentHost> 
                <Controls:RadPaneGroup x:Name="docPaneGroup">  
                    <Controls:RadDocumentPane Header="Document 1" Title="Document 1" /> 
                    <Controls:RadDocumentPane Header="Document 2" Title="Document 2" /> 
                </Controls:RadPaneGroup> 
            </Controls:RadDocking.DocumentHost> 
        </Controls:RadDocking> 
        <Button Content="Click" Width="100" Height="30" HorizontalAlignment="Center" Click="Button_Click" Grid.Row="1" Margin="0, 5"  /> 
    </Grid> 

And code behind:

        public void CreateFloatingWindow() {  
            var window = new RadPane();  
            docPaneGroup.AddItem(window, DockPosition.Center);  
            window.MakeFloatingOnly();  
        }  
 
        private void Button_Click(object sender, RoutedEventArgs e) {  
            CreateFloatingWindow();  
        } 

Can you replicate this? Am I doing anything wrong?

I can confirm this defect was not introduced with Q1 2010.

Regards,
James.

3 Answers, 1 is accepted

Sort by
0
Accepted
Kaloyan
Telerik team
answered on 18 Mar 2010, 10:14 AM
Hi James,

I would like to start with pointing out the incorrect way you are using the Docking control. The RadPaneGroup has to be always placed inside a RadSplitContainer. This is an expected behavior. When you add a new RadPane in RadPaneGroup the Items property of the RadPaneGroup refreshes and as a result the selected index becomes 0. To workaround this limitations you can add another empty group in the Document host where the new panes will be added. Follow the code posted bellow.

<Grid>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <telerikDocking:RadDocking>
                <telerikDocking:RadDocking.DocumentHost>
                    <telerikDocking:RadSplitContainer>
                        <telerikDocking:RadPaneGroup>
                            <telerikDocking:RadDocumentPane Header="Document 1" Title="Document 1" />
                            <telerikDocking:RadDocumentPane Header="Document 2" Title="Document 2" />
                        </telerikDocking:RadPaneGroup>
                        <telerikDocking:RadPaneGroup x:Name="docPaneGroup" />
                    </telerikDocking:RadSplitContainer>
                </telerikDocking:RadDocking.DocumentHost>
            </telerikDocking:RadDocking>
            <Button Content="Click" Width="100" Height="30" HorizontalAlignment="Center" Click="Button_Click" Grid.Row="1" Margin="0, 5"  />
        </Grid>



Best wishes,
Kaloyan
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
James
Top achievements
Rank 1
answered on 18 Mar 2010, 10:33 AM
Hi Kaloyan,

Thanks for the tip. I guess what I'm trying to do isn't supported by the Docking control currently - that is open a ToolWindow independent of any RadPaneGroups. I can see why the selected index changes when a new pane is added, but it doesn't make sense when the pane is hosted within a ToolWindow.

Regards,
James
0
Kaloyan
Telerik team
answered on 23 Mar 2010, 10:07 AM
Hello James,

There is another approach, you can create them in runtime.

var split = new RadSplitContainer();
var group = new RadPaneGroup();
var pane = new RadPane() { Header = "new pane" };
  
group.Items.Add(pane);
split.Items.Add(group);
radDocking.Items.Add(split);
  
pane.MakeFloatingOnly();


All the best,
Kaloyan
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
James
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
James
Top achievements
Rank 1
Share this question
or