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

Layout Cycle Error when creating TileView Programmatically

5 Answers 146 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Don Pruitt
Top achievements
Rank 1
Don Pruitt asked on 21 Nov 2009, 01:53 AM
I receive the following error when selecting tiles at run time:

Error: Unhandled Error in Silverlight Application
Code: 4008   
Category: RuntimeError      
Message: Layout cycle detected.  Layout could not complete.

I am creating the TileView programmatically with the following:
RadTileViewItem dashboardItem = new RadTileViewItem();  
             dashboardItem.Name = "Tile";  
             dashboardItem.Header = "Tile";  
             //dashboardItem.Content = "Tile Content";  
             dashboardItem.Height = 100;  
             dashboardItem.Width = 100;  
 
             RadFluidContentControl fluidContentControl = new RadFluidContentControl();  
 
             fluidContentControl.LargeContent = "This is the larger contant.  We can display charts and a whole lot more.";  
             fluidContentControl.SmallContent = "Small Content";  
             fluidContentControl.SmallToNormalThreshold = new Size(100, 75);  
             fluidContentControl.NormalToSmallThreshold = new Size(101, 76);  
             fluidContentControl.NormalToLargeThreshold = new Size(400, 200);  
             fluidContentControl.LargeToNormalThreshold = new Size(401, 201);  
 
             dashboardItem.Content = fluidContentControl;  
 
             RadTileView dashboard = _container.Resolve<RadTileView>("MainDashboard");  
 
             dashboard.Items.Add(dashboardItem);  
             dashboard.ReorderingEasing = new System.Windows.Media.Animation.ElasticEase();   
             dashboard.ResizingEasing = new System.Windows.Media.Animation.ExponentialEase();  
If I remove the Fluid Content Control, everyhting works, but I am am forced to have the same content on each display.  If I include the Fluid Content Control, I get the error when selecting the first small tile to enlarge.

Thanks.
RadMenuItem studentMenuItem = new RadMenuItem();  
             studentMenuItem.Name = "Student";  
             studentMenuItem.Header = "Student";  
 
             RadMenuItem studentAdd = new RadMenuItem();  
             studentAdd.Name = "Add Student";  
             studentAdd.Header = "Add Student";  
 
             studentMenuItem.Items.Add(studentAdd);  
 
             RadMenuItem studentUpdate = new RadMenuItem();  
             studentUpdate.Name = "Update Student";  
             studentUpdate.Header = "Update Student";  
 
             studentMenuItem.Items.Add(studentUpdate);  
 
             RadMenu menu = _container.Resolve<RadMenu>("MainMenu");  
             menu.Items.Add(studentMenuItem); 
Disregard the Menu Code.

5 Answers, 1 is accepted

Sort by
0
Tihomir Petkov
Telerik team
answered on 25 Nov 2009, 05:47 PM
Hi Don,

Thank you for your feedback. What you observed is a known bug which we will be working on for the upcoming service pack. However, you can use an alternative way of switching the visible content of the FluidContentControl which is demonstrated in the attached project. It is basically showing how to manually change the visible content every time a tile changes its state. Besides that, the attached sample uses DataTemplates which you may found more convenient than using code to create the wrapping FluidContentControls and set tile properties. Please take a look at the project and let me know if it will work for you.

All the best,
Tihomir Petkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Ludovic Gerbault
Top achievements
Rank 1
answered on 18 Jan 2010, 04:24 PM
I just want to let you know that the bug that is being refered to here still exists in Q3 SP2.

I've been able to get it by adding dynamically in the LargeContent of the RadFluidContentControl a stackpanel which contains a coverflow and a RadExpander.

After that, any state change would cause the exception.

Thanks for the workaround, it works great.
0
Tihomir Petkov
Telerik team
answered on 21 Jan 2010, 09:54 AM
Hi Subileau,

I was not able to reproduce the problem you reported. Can you please modify the sample project that I prepared to reproduce the errors?

Kind regards,
Tihomir Petkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Ludovic Gerbault
Top achievements
Rank 1
answered on 21 Jan 2010, 12:03 PM
I've modified your code to reproduce what I was trying to do at first.

I'm not getting the error per se, but actually, Firefox 3.6 beta RC2 and IE 8 are crashing as soon as the TileViewItem changes state, I'm uploading the projet in a support ticket

Regards
0
Tihomir Petkov
Telerik team
answered on 21 Jan 2010, 12:26 PM
Hello Subileau,

OK, we will continue this conversation in the support ticket you will open.

Sincerely yours,
Tihomir Petkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
TileView
Asked by
Don Pruitt
Top achievements
Rank 1
Answers by
Tihomir Petkov
Telerik team
Ludovic Gerbault
Top achievements
Rank 1
Share this question
or