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

[Solved] Dynamically Loaded Document Pane Content goes away when switching tabs

5 Answers 162 Views
Docking
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
D V
Top achievements
Rank 1
D V asked on 05 Feb 2009, 04:04 PM
All ,
I am using Docking control from Futures and can't figure out how to load content in code behind. Partial Xaml markup is as follows

 

<radDock:RadDocking x:Name="radDocking1">

 

 

<radDock:RadDocking.DocumentHostContent>

 

 

<radDock:RadPaneGroup x:Name="groupDocumentHostContent" >

 

 

<radDock:RadDocumentPane Title="Dash Board" x:Name="paneDashBoard" />

 

 

<radDock:RadDocumentPane Title="Users" x:Name="paneUsers" Content="Place Holder for Users" />

 

 

</radDock:RadPaneGroup>
..
..

In code behind I set the content in Page Constructor for "paneDashBoard" as below 

 

 

public partial class MainPage : UserControl

 

 

 

{

 

public MainPage()

 

{

    InitializeComponent();

 

    this.paneDashBoard.Content = new UserRequestDetail();
    ...
}

Markup  from UserRequestdetail is correctly loaded and displayed. How ever when i select Second Document under Document Host Content ( User pane) and switch back to first pane "dashBoardPane" , content is gone.

What is correct way to add new panes to "DocumentHostContent" area and load Content in code behind

Thanks
Rao

 

 

 

 

5 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 05 Feb 2009, 05:44 PM
Hi D V,

This is problem of the Silverlight platform. You will experience the same behavior if you try it with Microsoft TabControl. Just put 2 tabs. The content of the first tab should be string and the content of the second should be UIElement (Rectangle for example). After switching the tabs the Rectangle disappears. It is still there in the Content property by it is not shown.
The workaround is to use elements of the same type (strings only or UIElements only - and when you need to show some text use TextBlock instead of string).

We are searching for some workaround but I can't give any estimations.
Sorry for the troubles.

All the best,
Hristo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
D V
Top achievements
Rank 1
answered on 05 Feb 2009, 09:27 PM
Thanks Hirtio. I have figured it that is the case right after i posted. Now i can run my prototype fine on my local machine and i have deployed it to a test server. When i access the app from my machine , it run fine. How ever one of my testers is getting follwing error. Any suggestions how to troubleshoot this error? I can run Telerik Docking Deemo examples on the machine where i am receiving this exception


---------------------------

---------------------------
System.InvalidCastException: Unable to cast object of type 'System.windows.controls' to type 'System.windows.Controls.RadPaneGroup'

at SLTest1.LoginPage.InitilizeComponent()
at SLTest1.Ctor()


Thanks
Rao 

0
Hristo
Telerik team
answered on 06 Feb 2009, 09:38 AM
Hi D V,

We have seen this issue internally. It happens only on some machines and we think this is Silverlight XAML parser error.
As a workaround you can create new instance of RadPaneGroup in the Application constructor (before InitializeComponent method).

Let me know if this helps.

Sincerely yours,
Hristo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
D V
Top achievements
Rank 1
answered on 06 Feb 2009, 05:45 PM
Thanks Hristo . I have moved the code to load my content into panes into RadDocking Loaded event and i no lobger get this exception. Any idea on release date for Docking control and GridView. I am working on an application that needs to goto acceptance testing pretty soon and i can't tell them that we are still using pre release bits.

Thanks
Rao
0
Vlad
Telerik team
answered on 09 Feb 2009, 07:23 AM
Hi Rao,

Both controls will be part of our Q1 2009 release (early March).

Kind regards,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Docking
Asked by
D V
Top achievements
Rank 1
Answers by
Hristo
Telerik team
D V
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or