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

Cannot add panes to RadPaneGroup after deserializing

5 Answers 77 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Mladen
Top achievements
Rank 1
Mladen asked on 17 Jul 2013, 03:10 PM
Hi!

I have following XAML

 
    <telerik:RadDocking x:Name="Docking" ElementLoaded="Docking_OnElementLoaded" Grid.Row="1" telerik:RadDocking.SerializationTag="RadDocking">
         <telerik:RadDocking.DocumentHost> 
                <telerik:RadSplitContainer telerik:RadDocking.SerializationTag="SearchResultsContainer">
                    <telerik:RadPaneGroup>
                       ..........
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking.DocumentHost>

      <telerik:RadSplitContainer Width="390" Orientation="Vertical" x:Name="SearchCriteriaPane" InitialPosition="DockedLeft" telerik:RadDocking.SerializationTag="SearchCriteriaGroupContainer">
              <telerik:RadPaneGroup x:Name="SearchCriteriaGroup"    telerik:RadDocking.SerializationTag="SearchCriteriaGroup">
             
              </telerik:RadPaneGroup>
             </telerik:RadSplitContainer>
 
        
      </telerik:RadDocking>


I use the following code to add panes to this RadPaneGroup:

var criteriaView = new SearchCriteriaView() {DataContext = chriteria, HorizontalAlignment = HorizontalAlignment.Stretch};
var pane =
new RadPane() {Content = criteriaView, HorizontalContentAlignment = HorizontalAlignment.Stretch, CanUserClose = false, Title= tag};
this.SearchCriteriaGroup.Items.Add(pane);  
  


And I have the following problem:

When i add panes - everything goes ok (regardless of whether there are panes in the RadPane ot not).

When I close the application and save layout and than load layout (I recreate the content of panes manually, but the panes themselves are created at their right spots) - if there are panes after loading laypout in the RadPaneGroup when i try to add new panes - everything is fine

But when all panes are floating or docked somewhere else (not in the RadPaneGroup) when i load layout and try to add new pane (using the same code above - nothing happens - I can see in debug that items collection of RadPaneGroup is incremented, but the new pane is not visible 

Please help!

5 Answers, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 22 Jul 2013, 11:36 AM
Hi Mladen,

We have tried to reproduce the issue, but with no luck. I have tested few modification on the our Save\Load layout example in order to meet your specifications, but still I wasn't able to reproduce it. I have reproduced something similar, but it happens when after loading the layout a new auto generated PaneGroup is created instead of the old PaneGroup and in that case it is normal the Panes to be not visible as they are added to the wrong PaneGroup.
Nevertheless this should not happens in your scenario because the PaneGroup you are using has Seriazlization tag and it is saved and load with no need of creating new auto generated PaneGroup:
<telerik:RadPaneGroup x:Name="SearchCriteriaGroup"    telerik:RadDocking.SerializationTag="SearchCriteriaGroup">

So my guess would be that the new panes are added to the old PaneGroup, but there is a new auto generated one in her place and therefore the PaneGroup is not visible.
But this is only a guess and it would be great if you can send us a simple project showing the issue so we could debug it and be able to give you more information on the matter, modifying our SDK example would also work.

Regards,
Georgi
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Mladen
Top achievements
Rank 1
answered on 22 Jul 2013, 02:17 PM
Hi, I've created a simple solution wchich is reproducing the issue.

I coudnt attach it or reply to this post submitting a support ticked so here is the link to the solution (click File - Download):

https://docs.google.com/file/d/0B9h8habEj9Z3V3BhSHhTd2NfOWc/edit?usp=sharing

Here is how to reproduce the issue : 

I

1. Add seveal new panes.
4. Save layout 
5. Load layout
6. Try to add pane - it is added successfully.

II

1. Add seveal new panes.
2. Drag them to another location or make them float (all of them)
3. Add new pane again - it is added again
4. Make it also float
(of course last two steps are not needed - they are only for illustration)
5. Save layout 
6. Load layout
7. Try to add pane - IT IS NOT ADDED.

Meanwhile I found a solution - when deserializing in second case the Items Collection of RadDocking is empty, so is the Items collection of the SplitPanel. So i need to use following code which make things work:

       if (!this.Docking.Items.Any())
     {
         this.SearchCriteriaContainer.InitialPosition = DockState.DockedLeft;
         this.Docking.Items.Add(this.SearchCriteriaContainer);
     }
     if (!this.SearchCriteriaContainer.Items.Any())
     {
         this.SearchCriteriaContainer.Items.Add(this.SearchCriteriaGroup);
     }
     ((RadPaneGroup)(this.SearchCriteriaContainer).Items[0]).Items.Add(pane);


Still this behaviour is quite unexpected according to me and it should be if not fixed at least documented.

Please tell me whether there is another solution or maybe i cannot see some reason which makes this expected behaviour.

I hope this post will be helpfull for other users.
0
Georgi
Telerik team
answered on 25 Jul 2013, 08:35 AM
Hello Mladen,

I agree that it is a strange issue and it should be handle properly. So in order to find out if it is a bug, we should document it or take some other actions we should be able to reproduce it.
Unfortunately we have tried it in the project you have provided, but with no luck.
So it seems like we need to find where we differ so we can reproduce it and debug it properly.
I am attaching a video showing how the project behaves on my machine, it would be great if you can check it out and let me know if I am not missing something.
Please note that I am using Silverlight 5 assemblies on Silverlight 5.1.20513.0. Also I have .Net 4.5 installed on my machine.



Regards,
Georgi
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Mladen
Top achievements
Rank 1
answered on 25 Jul 2013, 10:02 AM
Hi, so it is of the worst kind of problems...

Me: Silverlight Version: 5.1.20125.0  
.NET 4.5

I cannot see something you are missing, maybe I'm missing something, I'm also sending a video showing what is happening here:

https://docs.google.com/file/d/0B9h8habEj9Z3UHN1aW5oV1JEZ0E/edit?usp=sharing

Ml
0
Georgi
Telerik team
answered on 30 Jul 2013, 06:50 AM
Hi Mladen,

I have noticed that you are using 2013.1.527.1050 which is an internal build before the Q2 2013 and I was able to reproduce the issue with that version of the assemblies. The good news is that it can not be reproduced with Q2 2013 (2013.2 611.1050) or later and it seems like the issue has been fixed.
It would be great if you can give it try in your big project with the Q2 2013 and let us know if everything works as expected with the Q2 2013 version of the controls.

Regards,
Georgi
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Docking
Asked by
Mladen
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Mladen
Top achievements
Rank 1
Share this question
or